﻿SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_module]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_module](
	[modid] [int] IDENTITY(1,1) NOT NULL,
	[modparent] [int] NULL CONSTRAINT [DF_hweb_module_modparent]  DEFAULT (0),
	[modname] [varchar](50) NULL,
	[modnameen] [varchar](50) NULL,
	[modurl] [varchar](50) NULL,
	[modrank] [tinyint] NULL CONSTRAINT [DF_hweb_module_modrank]  DEFAULT (0),
	[modcomment] [varchar](500) NULL,
 CONSTRAINT [PK_hweb_module] PRIMARY KEY CLUSTERED 
(
	[modid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[GroupName]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[GroupName](
	[id] [int] NOT NULL,
	[GroupName] [nvarchar](50) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sms_receive]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[sms_receive](
	[ref_id] [int] IDENTITY(1,1) NOT NULL,
	[orig_mobile] [varchar](255) NULL,
	[dest_number] [tinyint] NULL,
	[dest_mobile] [varchar](255) NULL,
	[content] [varchar](160) NULL,
	[fee_usertype] [tinyint] NULL,
	[fee_terminal_id] [char](21) NULL,
	[feetype] [int] NULL,
	[feecode] [int] NULL,
	[status_report] [tinyint] NULL,
	[status] [tinyint] NULL CONSTRAINT [DF_sms_receive_status]  DEFAULT (0),
	[smtype] [tinyint] NULL,
	[addby] [varchar](15) NULL,
	[add_time] [datetime] NULL CONSTRAINT [DF_sms_receive_add_time]  DEFAULT (getdate()),
	[svctype] [char](8) NULL,
	[user_cmd] [varchar](255) NULL,
	[linkid] [varchar](255) NULL,
	[reply_time] [datetime] NULL,
 CONSTRAINT [PK_sms_receive] PRIMARY KEY CLUSTERED 
(
	[ref_id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCMS_Season]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCMS_Season](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Property_ID] [int] NOT NULL,
	[Name] [varchar](50) NOT NULL,
	[Week] [varchar](100) NULL,
	[StartDate] [datetime] NULL,
	[EndDate] [datetime] NULL,
	[Description] [varchar](1000) NULL,
 CONSTRAINT [PK_HCMS_Season] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[User]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[User](
	[UserID] [int] IDENTITY(1,1) NOT NULL,
	[UserName] [nvarchar](50) NULL,
	[Email] [nvarchar](255) NULL,
	[UserPassword] [nvarchar](50) NULL,
	[signup_gender] [int] NULL CONSTRAINT [DF_User_signup_gender]  DEFAULT (0),
	[logins] [int] NULL CONSTRAINT [DF_User_logins]  DEFAULT (0),
	[lastlogin] [datetime] NULL CONSTRAINT [DF_User_lastlogin]  DEFAULT (getdate()),
	[endlogin] [datetime] NULL,
	[lockuser] [int] NULL CONSTRAINT [DF_User_lockuser]  DEFAULT (0),
	[realn] [nvarchar](50) NULL,
	[usercookies] [int] NULL CONSTRAINT [DF_User_usercookies]  DEFAULT (0),
	[birthday] [datetime] NULL,
	[UserLastIP] [nvarchar](15) NULL,
	[companyname] [varchar](800) NULL,
	[country] [nvarchar](50) NULL,
	[province] [nvarchar](50) NULL,
	[city] [nvarchar](50) NULL,
	[UserLevel] [int] NULL CONSTRAINT [DF_User_UserLevel]  DEFAULT (0),
	[UserLevel1] [varchar](50) NULL,
	[UserLevel2] [varchar](500) NULL,
	[Address] [nvarchar](255) NULL,
	[Tel] [nvarchar](50) NULL,
	[outcn] [int] NULL CONSTRAINT [DF_User_outcn]  DEFAULT (0),
	[IDcard] [nvarchar](50) NULL,
	[firstname] [nvarchar](50) NULL,
	[middlename] [nvarchar](50) NULL,
	[lastname] [nvarchar](50) NULL,
	[lastloginip] [nvarchar](50) NULL,
	[booktimes] [int] NULL CONSTRAINT [DF_User_booktimes]  DEFAULT (0),
	[totalmount] [decimal](19, 2) NULL CONSTRAINT [DF_User_totalmount]  DEFAULT (0),
	[roomnights] [int] NULL CONSTRAINT [DF_User_roomnights]  DEFAULT (0),
	[parentid] [int] NULL CONSTRAINT [DF_User_parentid]  DEFAULT (0),
	[usertype] [nvarchar](50) NULL,
	[congeal] [int] NULL CONSTRAINT [DF_User_congeal]  DEFAULT (0),
	[remark] [nvarchar](500) NULL,
 CONSTRAINT [PK_User] PRIMARY KEY CLUSTERED 
(
	[UserID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY],
 CONSTRAINT [IX_User] UNIQUE NONCLUSTERED 
(
	[UserName] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Hubs_HotelRegister]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Hubs_HotelRegister](
	[RID] [int] IDENTITY(1,1) NOT NULL,
	[CityID] [int] NULL,
	[CityName] [nvarchar](50) NOT NULL,
	[Address] [nvarchar](200) NOT NULL,
	[ZipCode] [varchar](6) NOT NULL,
	[HotelName] [nvarchar](200) NOT NULL,
	[Starts] [decimal](18, 1) NOT NULL,
	[Rooms] [int] NULL CONSTRAINT [DF_Hubs_HotelRegister_Rooms]  DEFAULT (0),
	[WebSite] [varchar](200) NULL,
	[Title] [nvarchar](50) NOT NULL,
	[LinkMan] [nvarchar](100) NOT NULL,
	[Business] [nvarchar](100) NULL,
	[Phone] [varchar](20) NULL,
	[Mobile] [varchar](12) NULL,
	[Fax] [varchar](12) NULL,
	[Email] [varchar](100) NULL,
	[Source] [varchar](100) NOT NULL,
	[Remark] [nvarchar](2000) NULL,
	[Facilities] [ntext] NULL,
	[RoomTypes] [ntext] NULL,
	[EmailTimes] [int] NULL DEFAULT (0),
 CONSTRAINT [PK_HUBS_HOTELREGISTER] PRIMARY KEY CLUSTERED 
(
	[RID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'酒店加盟记录表' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Hubs_HotelRegister'

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sms_send]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[sms_send](
	[ref_id] [int] IDENTITY(1,1) NOT NULL,
	[orig_mobile] [varchar](255) NULL,
	[dest_number] [tinyint] NULL,
	[dest_mobile] [varchar](255) NULL,
	[content] [varchar](160) NULL,
	[fee_usertype] [tinyint] NULL,
	[fee_terminal_id] [char](21) NULL,
	[feetype] [int] NULL CONSTRAINT [DF_sms_send_feetype]  DEFAULT (0),
	[feecode] [int] NULL CONSTRAINT [DF_sms_send_feecode]  DEFAULT (0),
	[status_report] [tinyint] NULL CONSTRAINT [DF_sms_send_status_report]  DEFAULT (0),
	[status] [tinyint] NULL CONSTRAINT [DF_sms_send_status]  DEFAULT (0),
	[smtype] [tinyint] NULL,
	[addby] [varchar](50) NULL,
	[add_time] [datetime] NULL CONSTRAINT [DF_sms_send_add_time]  DEFAULT (getdate()),
	[svctype] [char](8) NULL,
	[linkid] [varchar](255) NULL,
 CONSTRAINT [PK_sms_send] PRIMARY KEY CLUSTERED 
(
	[ref_id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Corp]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Corp](
	[Corp_id] [int] IDENTITY(1,1) NOT NULL,
	[Corp_name] [varchar](500) NULL,
	[Corp_name_e] [varchar](500) NULL,
	[Contract_NO] [nvarchar](50) NULL,
	[Corp_NO] [nvarchar](50) NULL,
	[updatetime] [datetime] NULL,
	[status] [int] NULL,
	[corp_type] [int] NULL,
	[industry_type] [nvarchar](50) NULL,
	[address] [nvarchar](500) NULL,
	[province] [nvarchar](50) NULL,
	[city1] [nvarchar](50) NULL,
	[city2] [nvarchar](50) NULL,
	[state] [nvarchar](50) NULL,
	[country] [nvarchar](50) NULL,
	[zipcode] [nvarchar](50) NULL,
	[c_gender] [nvarchar](50) NULL,
	[c_Fname] [nvarchar](50) NULL,
	[c_lname] [nvarchar](50) NULL,
	[tel] [nvarchar](50) NULL,
	[fax] [nvarchar](50) NULL,
	[email] [nvarchar](50) NULL,
	[resv_email] [nvarchar](50) NULL,
	[website] [nvarchar](50) NULL,
	[content] [ntext] NULL,
	[uploadfiles] [nvarchar](50) NULL,
	[photourl] [nvarchar](50) NULL,
	[editor] [nvarchar](50) NULL,
	[Hits] [int] NULL,
	[author] [nvarchar](50) NULL,
	[password] [nvarchar](255) NULL,
	[defaultrate] [nvarchar](255) NULL,
	[LastLoginIP] [nvarchar](50) NULL,
	[LastLogin] [nvarchar](50) NULL,
	[Logins] [int] NULL,
	[booktimes] [int] NULL,
	[totalmount] [money] NULL,
	[roomnights] [int] NULL,
	[ParentID] [int] NULL,
	[IATA] [varchar](50) NULL,
	[hotelGroupID] [nvarchar](2000) NULL,
	[NoHotelGroup] [nvarchar](1000) NULL,
	[SubSource] [nvarchar](50) NULL,
	[SendFax] [nvarchar](50) NULL,
	[account] [varchar](50) NULL,
	[accounttel] [nvarchar](50) NULL,
	[accountfax] [nvarchar](50) NULL,
	[accountemail] [nvarchar](50) NULL,
	[business] [nvarchar](50) NULL,
	[bsntel] [nvarchar](50) NULL,
	[bsnfax] [nvarchar](50) NULL,
	[bsnemail] [nvarchar](50) NULL,
	[credit] [int] NULL,
	[resvcredit] [nvarchar](50) NULL,
	[CustomHotel] [nvarchar](4000) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_Aircode]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_Aircode](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[name] [nvarchar](50) NULL,
	[name_e] [nvarchar](50) NULL,
	[code] [nvarchar](50) NULL,
	[type] [nvarchar](50) NULL,
 CONSTRAINT [PK_HCRS_Aircode] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_Airport]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_Airport](
	[airport_id] [int] IDENTITY(1,1) NOT NULL,
	[Property_id] [int] NULL,
	[AirportTrans] [nvarchar](255) NULL,
	[Airports] [nvarchar](255) NULL,
	[AirportDirection] [nvarchar](255) NULL,
	[AirportDistance] [int] NULL,
	[AirportUnits] [nvarchar](255) NULL,
 CONSTRAINT [PK_HCRS_Airport] PRIMARY KEY CLUSTERED 
(
	[airport_id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sms_group]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[sms_group](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[groupname] [varchar](100) NULL,
	[smsuserids] [varchar](2000) NULL,
	[userid] [varchar](50) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sms_user]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[sms_user](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[name] [varchar](50) NULL,
	[company] [varchar](100) NULL,
	[mobile] [varchar](20) NULL,
	[userid] [varchar](50) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_City]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_City](
	[CityID] [int] NOT NULL,
	[ProvinceID] [int] NULL,
	[Name] [nvarchar](50) NULL,
	[Remark] [nvarchar](50) NULL,
	[Latitude] [varchar](50) NULL,
	[Longitude] [varchar](50) NULL,
	[PhotoUrl] [nvarchar](100) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Hubs1_SMSSend]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Hubs1_SMSSend](
	[smsid] [int] IDENTITY(1,1) NOT NULL,
	[upperid] [int] NULL CONSTRAINT [DF_Hubs1_SMS_upperid]  DEFAULT (0),
	[mobile] [nvarchar](50) NULL,
	[content] [nvarchar](1000) NULL,
	[fail] [int] NULL CONSTRAINT [DF_Hubs1_SMS_fail]  DEFAULT (0),
	[sendtime] [datetime] NULL CONSTRAINT [DF_Hubs1_SMS_sendtime]  DEFAULT (getdate()),
	[status] [int] NULL CONSTRAINT [DF_Hubs1_SMS_status]  DEFAULT (0),
	[adduser] [int] NULL CONSTRAINT [DF_Hubs1_SMS_adduser]  DEFAULT (0),
 CONSTRAINT [PK_Hubs1_SMS] PRIMARY KEY CLUSTERED 
(
	[smsid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_Commercial]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_Commercial](
	[CommercialID] [int] NOT NULL,
	[CityID] [int] NULL,
	[Name] [nvarchar](50) NULL,
	[Remark] [varchar](50) NULL,
	[Latitude] [varchar](50) NULL,
	[Longitude] [varchar](50) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_present_sort]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_present_sort](
	[sid] [int] IDENTITY(1,1) NOT NULL,
	[sname] [varchar](50) NULL,
	[gid] [int] NULL,
	[pid] [int] NULL,
	[rank] [int] NULL CONSTRAINT [DF_hfg_present_sort_rank]  DEFAULT (0),
 CONSTRAINT [PK_hfg_present_sort] PRIMARY KEY CLUSTERED 
(
	[sid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_Country]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_Country](
	[countryid] [int] IDENTITY(1,1) NOT NULL,
	[code] [char](2) NULL,
	[countryname] [nvarchar](100) NULL,
	[languagetype] [int] NULL,
 CONSTRAINT [PK_HCRS_Country] PRIMARY KEY CLUSTERED 
(
	[countryid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_CxlRule]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_CxlRule](
	[Cxlrule_id] [int] IDENTITY(1,1) NOT NULL,
	[Property_id] [int] NULL,
	[NoTimeFrame] [nvarchar](50) NULL,
	[Rule] [nvarchar](50) NULL,
	[Rulelevel] [int] NULL,
	[Rulename] [nvarchar](100) NULL,
	[Description] [nvarchar](255) NULL,
	[PenaltyValue] [nvarchar](50) NULL,
	[CNumber] [int] NULL,
	[CancelInPenalty] [int] NULL,
	[NonRefundable] [nvarchar](50) NULL,
	[Period] [nvarchar](50) NULL,
	[Canceltime] [varchar](50) NULL,
	[Cancelday] [varchar](50) NULL,
	[languagetype] [int] NULL,
	[userid] [int] NULL,
	[updatetime] [datetime] NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DateTable]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[DateTable](
	[DDay] [datetime] NOT NULL,
	[DWeek] [int] NOT NULL,
 CONSTRAINT [PK_DateTable] PRIMARY KEY CLUSTERED 
(
	[DDay] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_Description]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_Description](
	[Hotel_ID] [int] IDENTITY(1,1) NOT NULL,
	[Property_id] [int] NULL,
	[UpdateTime] [datetime] NULL,
	[FrequentStay] [ntext] NULL,
	[Satety] [ntext] NULL,
	[Property] [ntext] NULL,
	[Rooms] [ntext] NULL,
	[Ratings] [ntext] NULL,
	[Meetings] [ntext] NULL,
	[Facilities] [ntext] NULL,
	[Transportation] [ntext] NULL,
	[Amenities] [ntext] NULL,
	[Recreation] [ntext] NULL,
	[Dining] [ntext] NULL,
	[Corporate] [ntext] NULL,
	[Attractions] [ntext] NULL,
	[Policies] [ntext] NULL,
	[MarketingVerbage] [ntext] NULL,
	[Commission] [ntext] NULL,
	[SpecialRate] [ntext] NULL,
	[Location] [ntext] NULL,
	[languagetype] [int] NULL,
	[directions] [ntext] NULL,
	[team] [ntext] NULL,
	[market] [ntext] NULL,
	[booking] [ntext] NULL,
	[usual] [ntext] NULL,
	[agent] [ntext] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_District]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_District](
	[DistrictID] [int] NOT NULL,
	[CityID] [int] NULL,
	[Name] [nvarchar](50) NULL,
	[Remark] [nvarchar](100) NULL,
	[Latitude] [varchar](50) NULL,
	[Longitude] [varchar](50) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[h_facility]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[h_facility](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[fclass] [int] NULL,
	[fname] [nvarchar](50) NULL,
	[languagetype] [int] NULL DEFAULT (0),
 CONSTRAINT [PK_H_FACILITY] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[WebServiceUser]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[WebServiceUser](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[UID] [nvarchar](50) NOT NULL,
	[PWD] [nvarchar](40) NOT NULL,
 CONSTRAINT [PK_WebServiceUser] PRIMARY KEY CLUSTERED 
(
	[UID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_Facility]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_Facility](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[fclass] [int] NULL,
	[fname] [nvarchar](50) NULL,
	[languagetype] [int] NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_admuser_setup]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_admuser_setup](
	[admid] [int] NOT NULL,
	[css] [varchar](4000) NULL,
	[languagetype] [tinyint] NULL CONSTRAINT [DF_hweb_admuser_setup_languagetype]  DEFAULT (0),
 CONSTRAINT [PK_HWEB_ADMUSER_SETUP] PRIMARY KEY CLUSTERED 
(
	[admid] DESC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_Facilityclass]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_Facilityclass](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[classname] [nvarchar](50) NULL,
	[classsort] [int] NULL,
	[languagetype] [int] NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Hubs1_SMSResv]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Hubs1_SMSResv](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[smsid] [int] NULL,
	[resvdate] [nvarchar](50) NULL,
	[resvtime] [nvarchar](50) NULL,
	[resvphone] [nvarchar](50) NULL,
	[resvcontent] [nvarchar](1000) NULL,
 CONSTRAINT [PK_Hubs1_SmsResv] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_GuaRule]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_GuaRule](
	[Guarule_id] [int] IDENTITY(1,1) NOT NULL,
	[Property_id] [int] NULL,
	[GType] [nvarchar](50) NULL,
	[Grule] [nvarchar](50) NULL,
	[Grulename] [nvarchar](100) NULL,
	[Grulelevel] [int] NULL,
	[GDescription] [nvarchar](255) NULL,
	[Gnumber] [int] NULL,
	[Gperiod] [nvarchar](50) NULL,
	[languagetype] [int] NULL,
	[updatetime] [datetime] NULL,
	[userid] [int] NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_Plan]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_Plan](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[property_id] [int] NOT NULL,
	[plancode] [varchar](50) NULL,
	[roomcode] [varchar](50) NULL,
	[planname] [varchar](200) NULL,
	[roomname] [varchar](200) NULL,
	[plandesc] [varchar](2000) NULL,
	[roomdesc] [varchar](2000) NULL,
	[updatetime] [datetime] NULL,
	[type] [varchar](50) NULL,
	[languagetype] [int] NULL,
	[available] [int] NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_Proptype]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_Proptype](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[propcode] [char](3) NOT NULL,
	[propname] [nvarchar](200) NULL,
	[languagetype] [int] NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_Province]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_Province](
	[ProvinceID] [int] NOT NULL,
	[ChinaAreaID] [int] NULL,
	[Name] [nvarchar](50) NULL,
	[Remark] [nvarchar](50) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Expotia_CityRemark]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Expotia_CityRemark](
	[CityID] [int] NOT NULL,
	[CityName] [nvarchar](100) NOT NULL,
	[Description] [nvarchar](2000) NOT NULL,
	[pic] [varchar](200) NOT NULL,
	[language] [int] NOT NULL DEFAULT (0),
 CONSTRAINT [PK_EXPOTIA_CITYREMARK] PRIMARY KEY CLUSTERED 
(
	[CityID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'城市介绍' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Expotia_CityRemark'

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[h_facilityclass]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[h_facilityclass](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[classname] [nvarchar](50) NULL,
	[classsort] [int] NULL DEFAULT (0),
	[languagetype] [int] NULL DEFAULT (0),
 CONSTRAINT [PK_H_FACILITYCLASS] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_ReceiveInfo]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_ReceiveInfo](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[pid] [int] NOT NULL,
	[type] [nvarchar](100) NULL,
	[template] [nvarchar](100) NULL,
	[way] [nvarchar](100) NULL,
	[address] [nvarchar](100) NULL,
	[starttime] [nvarchar](50) NULL,
	[endtime] [nvarchar](50) NULL,
	[weeks] [nvarchar](50) NULL,
	[remark] [nvarchar](500) NULL,
	[avaliable] [int] NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_RoomCode]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_RoomCode](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[roomcode] [nvarchar](50) NULL,
	[roomname] [nvarchar](100) NULL,
	[roomtype] [nvarchar](100) NULL,
	[bedtype] [nvarchar](100) NULL,
	[adult] [int] NULL,
	[adultadd] [int] NULL,
	[child] [int] NULL,
	[childadd] [int] NULL,
	[bedtotal] [int] NULL,
	[total] [int] NULL,
	[squaremeter] [nvarchar](50) NULL,
	[floor] [nvarchar](50) NULL,
	[other] [nvarchar](100) NULL,
	[remark] [nvarchar](1000) NULL,
	[avaliable] [int] NULL,
	[pid] [int] NOT NULL,
	[userid] [int] NULL,
	[updatetime] [datetime] NULL,
	[languagetype] [int] NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[NewsLetter]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[NewsLetter](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[lettername] [varchar](50) NULL,
	[letterdate] [datetime] NULL,
	[voteid] [int] NULL CONSTRAINT [DF_NewsLetter_voteid]  DEFAULT (0),
	[addperson] [varchar](50) NULL,
	[issend] [int] NULL,
	[sendids] [varchar](5000) NULL CONSTRAINT [DF_NewsLetter_sendids]  DEFAULT (',')
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_TaxRule]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_TaxRule](
	[Tax_id] [int] IDENTITY(1,1) NOT NULL,
	[Property_id] [int] NOT NULL,
	[Amount] [nvarchar](50) NULL,
	[Amount1] [decimal](18, 2) NULL,
	[Aunit] [nvarchar](50) NULL,
	[Basis] [nvarchar](50) NULL,
	[TypeCode] [nvarchar](50) NULL,
	[Description] [nvarchar](255) NULL,
	[FeeType] [nvarchar](50) NULL,
	[Spare] [nvarchar](50) NULL,
	[Code] [nvarchar](50) NULL,
	[Method] [nvarchar](50) NULL,
	[Application] [nvarchar](50) NULL,
	[StackOrder] [int] NULL,
	[languagetype] [int] NULL,
	[userid] [int] NULL,
	[updatetime] [datetime] NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Expotia_City]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Expotia_City](
	[EID] [int] IDENTITY(1,1) NOT NULL,
	[CityID] [int] NOT NULL,
	[SDate] [datetime] NOT NULL,
	[EDate] [datetime] NOT NULL,
	[EOrderNO] [int] NOT NULL DEFAULT (0),
	[IsTop] [bit] NOT NULL DEFAULT (0),
 CONSTRAINT [PK_EXPOTIA_CITY] PRIMARY KEY CLUSTERED 
(
	[CityID] ASC,
	[SDate] ASC,
	[EDate] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'重点城市
   ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Expotia_City'

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[NewsVote]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[NewsVote](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[votename] [varchar](1000) NULL,
	[voteoption] [varchar](3000) NULL,
	[addperson] [varchar](50) NULL,
	[addtime] [datetime] NULL,
	[mutiselect] [int] NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_Train]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_Train](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[Property_id] [int] NULL,
	[TrainTrans] [nvarchar](255) NULL,
	[TrainName] [nvarchar](255) NULL,
	[TrainDirection] [nvarchar](255) NULL,
	[TrainDistance] [int] NULL,
	[TrainUnits] [nvarchar](255) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[H_train]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[H_train](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[Property_id] [int] NULL,
	[TrainTrans] [nvarchar](255) NULL,
	[TrainName] [nvarchar](255) NULL,
	[TrainDirection] [nvarchar](255) NULL,
	[TrainDistance] [int] NULL,
	[TrainUnits] [nvarchar](255) NULL,
 CONSTRAINT [PK_H_TRAIN] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[NewsVoteResult]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[NewsVoteResult](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[voteid] [int] NULL,
	[choise] [varchar](50) NULL,
	[email] [varchar](100) NULL,
	[addtime] [datetime] NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_Hotel]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_Hotel](
	[Hotel_ID] [int] IDENTITY(1,1) NOT NULL,
	[SpecialID] [int] NULL,
	[Title_e] [nvarchar](255) NULL,
	[Title] [nvarchar](255) NULL,
	[pid_e] [int] NULL,
	[pid] [int] NOT NULL,
	[CopyFrom] [nvarchar](255) NULL,
	[Editor] [nvarchar](20) NULL,
	[Keywords] [nvarchar](255) NULL,
	[Hits] [int] NULL,
	[UpdateTime] [datetime] NULL,
	[Hot] [bit] NOT NULL,
	[OnTop] [bit] NOT NULL,
	[Elite] [bit] NOT NULL,
	[Passed] [bit] NOT NULL,
	[enPassed] [bit] NULL,
	[IncludePic] [bit] NOT NULL,
	[DefaultPicUrl] [nvarchar](255) NULL,
	[UploadFiles] [ntext] NULL,
	[PaginationType] [int] NULL,
	[GroupID] [int] NULL,
	[ClassID] [int] NULL,
	[Deleted] [bit] NOT NULL,
	[Stars] [int] NULL,
	[Diamond] [int] NULL,
	[TitleFontColor] [nvarchar](7) NULL,
	[TitleFontType] [int] NULL,
	[subtitle_e] [ntext] NULL,
	[subtitle] [ntext] NULL,
	[lowprice] [int] NULL,
	[highprice] [int] NULL,
	[photourl] [nvarchar](50) NULL,
	[ratescount] [int] NULL,
	[address] [nvarchar](50) NULL,
	[resvemail] [nvarchar](50) NULL,
	[booktimes] [int] NULL,
	[modtimes] [int] NULL,
	[cxltimes] [int] NULL,
	[photocount] [int] NULL,
	[AmenityFlags] [nvarchar](255) NULL,
	[AmenityIDs] [int] NULL,
	[DateActivated] [nvarchar](50) NULL,
	[Userstamp] [nvarchar](50) NULL,
	[Holdtime] [nvarchar](50) NULL,
	[City] [nvarchar](50) NULL,
	[State] [nvarchar](50) NULL,
	[Country] [nvarchar](50) NULL,
	[Gmtoffset] [nvarchar](50) NULL,
	[Phone] [nvarchar](50) NULL,
	[Fax] [nvarchar](50) NULL,
	[Latecheckin] [nvarchar](50) NULL,
	[Checkin] [nvarchar](50) NULL,
	[Checkout] [nvarchar](50) NULL,
	[PriceRangeHigh] [int] NULL,
	[PriceRangeLow] [int] NULL,
	[KingBeds] [int] NULL,
	[QueenBeds] [int] NULL,
	[TwinBeds] [int] NULL,
	[DoubleBeds] [int] NULL,
	[ExtraAdult] [int] NULL,
	[MeetingRooms] [int] NULL,
	[MeetingSquareFeet] [int] NULL,
	[MeetingRoomCapacity] [int] NULL,
	[TotalElevators] [int] NULL,
	[TotalFloors] [int] NULL,
	[TotalSuites] [int] NULL,
	[TotalRooms] [int] NULL,
	[HandicappedRooms] [int] NULL,
	[MaxPropertyOccupancy] [int] NULL,
	[ExtraCharges] [nvarchar](255) NULL,
	[NonSmokingRooms] [nvarchar](50) NULL,
	[CTY] [nvarchar](50) NULL,
	[Longitude] [nvarchar](50) NULL,
	[Latitude] [nvarchar](50) NULL,
	[Timezone] [nvarchar](50) NULL,
	[Address1_e] [nvarchar](255) NULL,
	[Address1] [nvarchar](255) NULL,
	[Address2_e] [nvarchar](255) NULL,
	[Address2] [nvarchar](255) NULL,
	[ExtraChild] [nvarchar](50) NULL,
	[Daterenovated] [nvarchar](50) NULL,
	[Status] [nvarchar](50) NULL,
	[PropType] [nvarchar](50) NULL,
	[DiamondRating] [int] NULL,
	[Currency] [nvarchar](50) NULL,
	[Description] [nvarchar](50) NULL,
	[FOP] [nvarchar](255) NULL,
	[Zip] [nvarchar](50) NULL,
	[Directions] [nvarchar](1000) NULL,
	[PMS] [nvarchar](50) NULL,
	[DateOpened] [nvarchar](50) NULL,
	[Yearlyclosure] [nvarchar](50) NULL,
	[StatusDesc] [nvarchar](50) NULL,
	[credit] [int] NULL,
	[pagerank] [int] NULL,
	[enPagerank] [int] NULL,
	[languagetype] [int] NULL,
	[contact_name] [nvarchar](50) NULL,
	[contact_title] [nvarchar](50) NULL,
	[Countryid] [nvarchar](50) NULL,
	[Provinceid] [int] NULL,
	[Cityid] [int] NULL,
	[Districtid] [int] NULL,
	[Commercialid] [int] NULL,
	[ServiceCharge] [int] NULL,
	[localLongitude] [nvarchar](50) NULL,
	[localLatitude] [nvarchar](50) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Newsfeedback]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Newsfeedback](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[newsid] [int] NULL,
	[title] [varchar](100) NULL,
	[content] [ntext] NULL,
	[author] [varchar](50) NULL,
	[addtime] [datetime] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_Season]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_Season](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Property_ID] [int] NOT NULL,
	[Name] [varchar](50) NOT NULL,
	[Week] [varchar](100) NULL,
	[StartDate] [datetime] NULL,
	[EndDate] [datetime] NULL,
	[Description] [varchar](1000) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Expotia_Hotel]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Expotia_Hotel](
	[Hotel_ID] [int] NOT NULL,
	[IsTop] [bit] NOT NULL DEFAULT (0),
	[DateFrom] [datetime] NOT NULL,
	[DateEnd] [datetime] NOT NULL,
	[OrderNO] [int] NULL DEFAULT (0),
 CONSTRAINT [PK_EXPOTIA_HOTEL] PRIMARY KEY CLUSTERED 
(
	[Hotel_ID] ASC,
	[DateFrom] ASC,
	[DateEnd] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Expotia推荐酒店' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Expotia_Hotel'

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[temp_cache]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[temp_cache](
	[Property_id] [int] NOT NULL,
	[plancode] [varchar](50) NOT NULL,
	[Availdate] [datetime] NOT NULL,
	[singlerate] [decimal](18, 0) NULL,
	[doublerate] [decimal](10, 0) NULL,
	[triplerate] [decimal](10, 0) NULL,
	[quadrate] [decimal](10, 0) NULL,
	[extraadult] [decimal](10, 0) NULL,
	[extrachildren] [decimal](10, 0) NULL,
	[Allotment] [int] NULL,
	[AllotMax] [int] NULL,
	[AvStat] [varchar](50) NULL,
	[MaxLos] [int] NULL,
	[MinLos] [int] NULL,
	[RateCode] [varchar](50) NULL,
	[RoomCode] [nvarchar](50) NULL,
	[Tcode] [char](10) NULL,
	[T_from] [datetime] NULL,
	[T_to] [datetime] NULL,
	[Roomdesc] [varchar](500) NULL,
	[Ratedesc] [varchar](500) NULL,
	[Gua] [nvarchar](50) NULL,
	[Cxl] [nvarchar](50) NULL,
	[PriceNoTax] [decimal](18, 2) NULL,
	[cutOff] [int] NULL,
	[flag] [int] NULL,
 CONSTRAINT [PK_temp_cache] PRIMARY KEY CLUSTERED 
(
	[Property_id] ASC,
	[plancode] ASC,
	[Availdate] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[R_OverTime]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[R_OverTime](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[verifycode] [nvarchar](100) NULL,
	[state] [int] NULL CONSTRAINT [DF_R_OverTime_state]  DEFAULT (0),
	[confnum] [nvarchar](50) NULL,
	[username] [nvarchar](100) NULL,
	[iata] [nvarchar](100) NULL,
	[upddate] [datetime] NULL CONSTRAINT [DF_R_OverTime_upddate]  DEFAULT (getdate()),
	[hotelname] [nvarchar](200) NULL,
 CONSTRAINT [PK_R_OverTime] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CorpGetResvLastDate]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[CorpGetResvLastDate](
	[Corp_Id] [int] NOT NULL,
	[CorpGetDate] [datetime] NOT NULL,
 CONSTRAINT [PK_CropGetResvLastDate] PRIMARY KEY CLUSTERED 
(
	[Corp_Id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[resvlog]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[resvlog](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[userid] [int] NULL,
	[usertype] [nvarchar](50) NULL,
	[propertyid] [int] NOT NULL,
	[roomtype] [nvarchar](50) NULL,
	[rateclass] [nvarchar](50) NULL,
	[starttime] [datetime] NOT NULL,
	[deptime] [datetime] NOT NULL,
	[starture] [datetime] NULL,
	[departure] [datetime] NULL CONSTRAINT [DF_resvlog_departure]  DEFAULT (1900 - 1 - 1),
	[nights] [int] NULL CONSTRAINT [DF_resvlog_nights]  DEFAULT (0),
	[room] [int] NULL CONSTRAINT [DF_resvlog_room]  DEFAULT (0),
	[guestfirstname] [nvarchar](50) NULL,
	[guestlastname] [nvarchar](50) NULL,
	[guestemail] [nvarchar](50) NULL,
	[guestphone] [nvarchar](50) NULL,
	[guestMP] [nvarchar](50) NULL,
	[guestaddressline1] [nvarchar](50) NULL,
	[guestaddressline2] [nvarchar](50) NULL,
	[guestcity] [nvarchar](50) NULL,
	[guestcountry] [nvarchar](50) NULL,
	[gueststate] [nvarchar](50) NULL,
	[guestzip] [nvarchar](50) NULL,
	[cctype] [nvarchar](50) NULL,
	[ccnumber] [nvarchar](50) NULL,
	[ccname] [nvarchar](50) NULL,
	[ccexpyear] [nvarchar](50) NULL,
	[ccexpmonth] [nvarchar](50) NULL,
	[frequentguestid] [nvarchar](50) NULL,
	[iata] [nvarchar](50) NOT NULL,
	[remarks] [ntext] NULL,
	[confnum] [nvarchar](50) NULL,
	[outconfnum] [nvarchar](50) NULL,
	[cxlnum] [nvarchar](50) NULL,
	[status] [nvarchar](50) NULL,
	[propertyname] [nvarchar](500) NULL,
	[propertyname_e] [nvarchar](500) NULL,
	[totalmount] [nvarchar](50) NULL,
	[dailyprice] [nvarchar](2000) NULL,
	[adults] [int] NULL CONSTRAINT [DF_resvlog_adults]  DEFAULT (0),
	[children] [int] NULL CONSTRAINT [DF_resvlog_children]  DEFAULT (0),
	[plandesc] [nvarchar](500) NULL,
	[roomname] [nvarchar](500) NULL,
	[roomdesc] [nvarchar](500) NULL,
	[canclerule] [nvarchar](500) NULL,
	[guaranteerule] [nvarchar](500) NULL,
	[taxRule] [nvarchar](500) NULL,
	[incomingcall] [nvarchar](50) NULL,
	[fromurl] [nvarchar](255) NULL,
	[deleted] [int] NULL CONSTRAINT [DF_resvlog_deleted]  DEFAULT (0),
	[updatetime] [datetime] NULL CONSTRAINT [DF_resvlog_updatetime]  DEFAULT (getdate()),
	[ccupdatetime] [datetime] NULL,
	[conftime] [datetime] NULL,
	[SubSource] [nvarchar](50) NULL,
	[lastuser] [nvarchar](50) NULL,
	[lastusertype] [nvarchar](50) NULL,
	[getstatus] [int] NULL CONSTRAINT [DF_resvlog_getstatus]  DEFAULT (0),
	[totalrevenue] [decimal](18, 2) NULL CONSTRAINT [DF_resvlog_totalrevenue]  DEFAULT (0),
	[verifycode] [nvarchar](50) NOT NULL,
	[flgorder] [int] NULL CONSTRAINT [DF_resvlog_flgorder]  DEFAULT (0),
	[pmsno] [nvarchar](100) NULL,
	[roomno] [nvarchar](100) NULL,
	[deplistno] [nvarchar](50) NULL,
	[cclog] [nvarchar](500) NULL,
	[ccdanbao] [int] NULL CONSTRAINT [DF_resvlog_ccdanbao]  DEFAULT (0),
	[ccdanbaocon] [int] NULL CONSTRAINT [DF_resvlog_ccdanbaocon]  DEFAULT (2),
	[payment] [nvarchar](50) NULL,
	[channel] [nvarchar](50) NULL,
	[fit_userid] [uniqueidentifier] NULL,
	[pay] [int] NULL CONSTRAINT [DF_resvlog_pay]  DEFAULT (0),
	[modpaydate] [datetime] NULL CONSTRAINT [DF_resvlog_modpaydate]  DEFAULT (getdate()),
	[issuc] [int] NULL,
	[isfeedback] [int] NULL CONSTRAINT [DF_resvlog_isfeedback]  DEFAULT (0),
	[CurrencyCode] [varchar](5) NULL,
 CONSTRAINT [PK_resvlog] PRIMARY KEY CLUSTERED 
(
	[id] ASC,
	[propertyid] ASC,
	[starttime] ASC,
	[deptime] ASC,
	[iata] ASC,
	[verifycode] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'实际到店日期' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'resvlog', @level2type=N'COLUMN', @level2name=N'starture'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'GDS预订日期' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'resvlog', @level2type=N'COLUMN', @level2name=N'conftime'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'担保确认标志：0，普通单；1，已确认；2，未确认。' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'resvlog', @level2type=N'COLUMN', @level2name=N'ccdanbaocon'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'招行奥运支付状态:0-未支付、1-已支付、2-支付失败' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'resvlog', @level2type=N'COLUMN', @level2name=N'pay'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'招行奥运订单支付时间' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'resvlog', @level2type=N'COLUMN', @level2name=N'modpaydate'

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_present_consume]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_present_consume](
	[conid] [int] IDENTITY(1,1) NOT NULL,
	[prsid] [int] NULL,
	[gid] [int] NULL,
	[pid] [int] NULL,
	[prsname] [varchar](50) NULL,
	[simg] [varchar](50) NULL,
	[bimg] [varchar](50) NULL,
	[prscomment] [text] NULL,
	[prsscore] [decimal](10, 0) NULL,
	[uid] [int] NULL,
	[condate] [datetime] NULL,
	[precount] [int] NULL,
	[concount] [decimal](10, 0) NULL,
	[enddate] [datetime] NULL,
	[prscode] [varchar](10) NULL,
	[prstype] [tinyint] NULL CONSTRAINT [DF_hweb_present_consume_prstype]  DEFAULT (0),
	[status] [tinyint] NULL CONSTRAINT [DF_hfg_present_consume_status]  DEFAULT (0),
	[modiuser] [varchar](50) NULL,
	[modidate] [datetime] NULL CONSTRAINT [DF_hfg_present_consume_modidate]  DEFAULT (getdate()),
	[modicomment] [text] NULL,
	[fogid] [varchar](50) NULL,
	[verifycode] [varchar](50) NULL,
 CONSTRAINT [PK_hweb_present_consume] PRIMARY KEY CLUSTERED 
(
	[conid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Special]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Special](
	[SpecialID] [int] IDENTITY(1,1) NOT NULL,
	[SpecialName] [nvarchar](50) NULL,
	[OrderID] [int] NULL,
	[ReadMe] [nvarchar](255) NULL,
	[SkinID] [int] NULL,
	[LayoutID] [int] NULL,
	[BrowsePurview] [int] NULL,
	[AddPurview] [int] NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[H_description]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[H_description](
	[Hotel_ID] [int] IDENTITY(1,1) NOT NULL,
	[Property_id] [int] NULL,
	[UpdateTime] [datetime] NULL CONSTRAINT [DF_H_description_UpdateTime]  DEFAULT (getdate()),
	[FrequentStay] [ntext] NULL,
	[Satety] [ntext] NULL,
	[Property] [ntext] NULL,
	[Rooms] [ntext] NULL,
	[Ratings] [ntext] NULL,
	[Meetings] [ntext] NULL,
	[Facilities] [ntext] NULL,
	[Transportation] [ntext] NULL,
	[Amenities] [ntext] NULL,
	[Recreation] [ntext] NULL,
	[Dining] [ntext] NULL,
	[Corporate] [ntext] NULL,
	[Attractions] [ntext] NULL,
	[Policies] [ntext] NULL,
	[MarketingVerbage] [ntext] NULL,
	[Commission] [ntext] NULL,
	[SpecialRate] [ntext] NULL,
	[Location] [ntext] NULL,
	[languagetype] [int] NULL,
	[directions] [ntext] NULL,
	[team] [ntext] NULL,
	[market] [ntext] NULL,
	[booking] [ntext] NULL,
	[usual] [ntext] NULL,
	[agent] [ntext] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_AIR]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_AIR](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[Property_id] [int] NOT NULL,
	[Level] [varchar](10) NULL,
	[RoomCode] [varchar](50) NOT NULL,
	[PlanCode] [varchar](50) NOT NULL,
	[Source] [varchar](20) NULL,
	[Year] [int] NOT NULL,
	[January_AI] [image] NULL,
	[February_AI] [image] NULL,
	[March_AI] [image] NULL,
	[April_AI] [image] NULL,
	[May_AI] [image] NULL,
	[June_AI] [image] NULL,
	[July_AI] [image] NULL,
	[August_AI] [image] NULL,
	[September_AI] [image] NULL,
	[October_AI] [image] NULL,
	[November_AI] [image] NULL,
	[December_AI] [image] NULL,
	[January_R] [image] NULL,
	[February_R] [image] NULL,
	[March_R] [image] NULL,
	[April_R] [image] NULL,
	[May_R] [image] NULL,
	[June_R] [image] NULL,
	[July_R] [image] NULL,
	[August_R] [image] NULL,
	[September_R] [image] NULL,
	[October_R] [image] NULL,
	[November_R] [image] NULL,
	[December_R] [image] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[H_Sales]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[H_Sales](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[classid] [int] NULL,
	[title] [varchar](1000) NULL,
	[content] [nvarchar](1000) NULL,
	[pagerank] [int] NULL,
	[starttime] [datetime] NULL,
	[endtime] [datetime] NULL,
	[hid] [int] NULL,
	[updatetime] [datetime] NULL CONSTRAINT [DF_H_Sales_updatetime]  DEFAULT (getdate()),
 CONSTRAINT [PK_H_Sales] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CRM_Groupweb_domain]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[CRM_Groupweb_domain](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[ClassID] [int] NOT NULL DEFAULT (0),
	[webdomain] [varchar](50) NULL,
	[noscroll] [int] NULL DEFAULT (1),
	[RateCode] [varchar](500) NULL,
	[css] [varchar](4000) NULL,
	[sloganResv] [nvarchar](4000) NULL,
	[sloganMod] [nvarchar](4000) NULL,
	[sloganCxl] [nvarchar](4000) NULL,
	[sloganNewResv] [nvarchar](4000) NULL,
	[EmailFrom] [varchar](50) NULL,
	[EmailAlias] [varchar](50) NULL,
	[EmailTitle] [nvarchar](100) NULL,
	[languagetype] [int] NULL DEFAULT (0),
 CONSTRAINT [PK_CRM_Groupweb_domain] PRIMARY KEY CLUSTERED 
(
	[id] ASC,
	[ClassID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_Corp]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_Corp](
	[Corp_id] [int] IDENTITY(1,1) NOT NULL,
	[Corp_name] [varchar](500) NULL,
	[Corp_name_e] [varchar](500) NULL,
	[Contract_NO] [nvarchar](50) NULL,
	[Corp_NO] [nvarchar](50) NULL,
	[updatetime] [datetime] NULL,
	[status] [int] NULL,
	[corp_type] [int] NULL,
	[industry_type] [nvarchar](50) NULL,
	[address] [nvarchar](500) NULL,
	[province] [nvarchar](50) NULL,
	[city1] [nvarchar](50) NULL,
	[city2] [nvarchar](50) NULL,
	[state] [nvarchar](50) NULL,
	[country] [nvarchar](50) NULL,
	[zipcode] [nvarchar](50) NULL,
	[c_gender] [nvarchar](50) NULL,
	[c_Fname] [nvarchar](50) NULL,
	[c_lname] [nvarchar](50) NULL,
	[tel] [nvarchar](50) NULL,
	[fax] [nvarchar](50) NULL,
	[email] [nvarchar](50) NULL,
	[resv_email] [nvarchar](50) NULL,
	[website] [nvarchar](50) NULL,
	[content] [ntext] NULL,
	[uploadfiles] [nvarchar](50) NULL,
	[photourl] [nvarchar](50) NULL,
	[editor] [nvarchar](50) NULL,
	[Hits] [int] NULL,
	[author] [nvarchar](50) NULL,
	[password] [nvarchar](255) NULL,
	[defaultrate] [nvarchar](255) NULL,
	[LastLoginIP] [nvarchar](50) NULL,
	[LastLogin] [nvarchar](50) NULL,
	[Logins] [int] NULL,
	[booktimes] [int] NULL,
	[totalmount] [money] NULL,
	[roomnights] [int] NULL,
	[ParentID] [int] NULL,
	[IATA] [varchar](50) NULL,
	[hotelGroupID] [nvarchar](2000) NULL,
	[NoHotelGroup] [nvarchar](1000) NULL,
	[SubSource] [nvarchar](50) NULL,
	[SendFax] [nvarchar](50) NULL,
	[account] [varchar](50) NULL,
	[accounttel] [nvarchar](50) NULL,
	[accountfax] [nvarchar](50) NULL,
	[accountemail] [nvarchar](50) NULL,
	[business] [nvarchar](50) NULL,
	[bsntel] [nvarchar](50) NULL,
	[bsnfax] [nvarchar](50) NULL,
	[bsnemail] [nvarchar](50) NULL,
	[credit] [int] NULL,
	[resvcredit] [nvarchar](50) NULL,
	[CustomHotel] [nvarchar](4000) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_admuser]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_admuser](
	[admid] [int] IDENTITY(1,1) NOT NULL,
	[orgid] [int] NULL,
	[orgtype] [tinyint] NULL CONSTRAINT [DF_hweb_admuser_orgtype]  DEFAULT (0),
	[adm] [tinyint] NULL CONSTRAINT [DF_hweb_admuser_adm]  DEFAULT (0),
	[rolid] [int] NULL,
	[logname] [varchar](50) NOT NULL,
	[logpassword] [varchar](50) NULL,
	[usrname] [varchar](100) NULL,
	[usremail] [varchar](200) NULL,
	[usrcontact] [varchar](500) NULL,
	[admstatus] [tinyint] NULL CONSTRAINT [DF_hweb_admuser_admstatus]  DEFAULT (0),
	[lastip] [varchar](20) NULL,
	[lastdate] [datetime] NULL,
	[logcount] [int] NULL,
	[indate] [datetime] NULL,
	[inuser] [varchar](50) NULL,
 CONSTRAINT [PK_hweb_admuser] PRIMARY KEY CLUSTERED 
(
	[logname] ASC,
	[admid] DESC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_CorpUser]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_CorpUser](
	[UserID] [int] IDENTITY(1,1) NOT NULL,
	[UserName] [nvarchar](50) NULL,
	[Email] [nvarchar](255) NULL,
	[UserPassword] [nvarchar](50) NULL,
	[signup_gender] [int] NULL,
	[logins] [int] NULL,
	[lastlogin] [datetime] NULL,
	[endlogin] [datetime] NULL,
	[lockuser] [int] NULL,
	[realn] [nvarchar](50) NULL,
	[usercookies] [int] NULL,
	[birthday] [datetime] NULL,
	[UserLastIP] [nvarchar](15) NULL,
	[companyname] [varchar](800) NULL,
	[country] [nvarchar](50) NULL,
	[province] [nvarchar](50) NULL,
	[city] [nvarchar](50) NULL,
	[UserLevel] [int] NULL,
	[UserLevel1] [varchar](50) NULL,
	[UserLevel2] [varchar](500) NULL,
	[Address] [nvarchar](255) NULL,
	[Tel] [nvarchar](50) NULL,
	[outcn] [int] NULL,
	[IDcard] [nvarchar](50) NULL,
	[firstname] [nvarchar](50) NULL,
	[middlename] [nvarchar](50) NULL,
	[lastname] [nvarchar](50) NULL,
	[lastloginip] [nvarchar](50) NULL,
	[booktimes] [int] NULL,
	[totalmount] [decimal](19, 2) NULL,
	[roomnights] [int] NULL,
	[parentid] [int] NULL,
	[usertype] [nvarchar](50) NULL,
	[congeal] [int] NULL,
	[remark] [nvarchar](500) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[pay]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[pay](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[confnum] [nvarchar](50) NULL,
	[billno] [nvarchar](50) NULL,
	[paytimebegin] [datetime] NULL,
	[paytimeend] [datetime] NULL,
	[payamount] [nvarchar](50) NULL,
	[payman] [nvarchar](50) NULL,
	[status] [int] NULL,
	[hotelname] [nvarchar](50) NULL,
	[hotelname_e] [nvarchar](50) NULL,
	[firstname] [nvarchar](50) NULL,
	[lastname] [nvarchar](50) NULL,
	[checkin] [nvarchar](50) NULL,
	[checkout] [nvarchar](50) NULL,
	[nights] [nvarchar](50) NULL,
	[plandesc] [nvarchar](500) NULL,
	[roomdesc] [nvarchar](500) NULL,
	[room] [nvarchar](50) NULL,
	[adult] [nvarchar](50) NULL,
	[children] [nvarchar](50) NULL,
	[totalmount] [nvarchar](50) NULL,
	[Cdescription] [nvarchar](500) NULL,
	[Gdescription] [nvarchar](500) NULL,
	[remark] [nvarchar](500) NULL,
	[signmd5] [varchar](500) NULL,
	[Address1_e] [nvarchar](50) NULL,
	[Address1] [nvarchar](50) NULL,
	[Phone] [nvarchar](50) NULL,
	[CancellationPolicy] [nvarchar](500) NULL,
	[GuaranteePolicy] [nvarchar](500) NULL,
	[currency] [nvarchar](5) NULL,
 CONSTRAINT [PK_pay] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY],
 CONSTRAINT [IX_pay_billno] UNIQUE NONCLUSTERED 
(
	[billno] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Log]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Log](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Title] [nvarchar](50) NULL,
	[Event] [nvarchar](200) NULL,
	[Add_Date] [datetime] NULL,
	[Ip] [nvarchar](50) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hr]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hr](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[storename] [nvarchar](255) NULL,
	[content] [ntext] NULL,
	[adress] [nvarchar](255) NULL,
	[tel] [nvarchar](255) NULL,
	[contactor] [nvarchar](255) NULL,
	[daytime] [nvarchar](50) NULL,
	[salary] [nvarchar](50) NULL,
	[stype] [int] NULL CONSTRAINT [DF_hr_stype]  DEFAULT (0),
	[location] [int] NULL CONSTRAINT [DF_hr_location]  DEFAULT (0),
	[language] [int] NULL CONSTRAINT [DF_hr_language]  DEFAULT (0),
 CONSTRAINT [PK_hr] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[T_DailyRates]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[T_DailyRates](
	[DailyRatesID] [varchar](64) NOT NULL,
	[HotelCode] [varchar](16) NULL,
	[RoomType] [varchar](16) NULL,
	[RateCode] [varchar](16) NULL,
	[RatePlan] [varchar](32) NULL,
	[PeriodDate] [datetime] NULL,
	[AvailDate] [datetime] NULL,
	[AvStat] [varchar](16) NULL,
	[Allotment] [int] NULL,
	[LeadTime] [int] NULL,
	[MinLOS] [int] NULL,
	[MaxLOS] [int] NULL,
	[SingleRates] [numeric](8, 2) NULL,
	[DoubleRates] [numeric](8, 2) NULL,
	[TripleRates] [numeric](8, 2) NULL,
	[QuadRates] [numeric](8, 2) NULL,
	[ExtraPersonRates] [numeric](8, 2) NULL,
	[ExtraChildRates] [numeric](8, 2) NULL,
	[Currency] [varchar](16) NULL,
	[RefType] [varchar](64) NULL,
	[RefID] [varchar](64) NULL,
	[BreakfastAmount] [numeric](8, 2) NULL,
	[BreakfastNumber] [int] NULL,
	[GUA] [text] NULL,
	[CXL] [text] NULL,
	[Status] [varchar](16) NULL CONSTRAINT [DF__T_DailyRa__Statu__4C764630]  DEFAULT ('Active'),
	[Sign] [varchar](16) NULL CONSTRAINT [DF__T_DailyRat__Sign__4D6A6A69]  DEFAULT ('0'),
	[LastModifierID] [varchar](64) NULL,
	[LastModifyDate] [datetime] NULL,
	[CreatorID] [varchar](64) NULL,
	[CreateDate] [datetime] NULL,
 CONSTRAINT [PK_T_DAILYRATES] PRIMARY KEY NONCLUSTERED 
(
	[DailyRatesID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_ResvLog]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_ResvLog](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Property_ID] [int] NULL,
	[UserID] [int] NULL,
	[Status] [varchar](50) NULL,
	[Confnum] [nvarchar](50) NULL,
	[IATA] [varchar](50) NULL,
	[CxlNum] [varchar](50) NULL,
	[ResvTime] [datetime] NULL,
	[UpdateTime] [datetime] NULL,
	[Subsource] [varchar](50) NULL,
	[VerifyCode] [uniqueidentifier] NOT NULL,
	[Remarks] [text] NULL,
 CONSTRAINT [PK_HCRS_ResvLog] PRIMARY KEY CLUSTERED 
(
	[ID] ASC,
	[VerifyCode] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_RateCode]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_RateCode](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[rate] [nvarchar](50) NULL,
	[name] [nvarchar](50) NULL,
	[RPI] [nvarchar](50) NULL,
	[CorpAccount] [nvarchar](50) NULL,
	[FreqGuest] [nvarchar](50) NULL,
	[Desc1] [nvarchar](500) NULL,
	[Desc2] [nvarchar](500) NULL,
	[Desc3] [nvarchar](500) NULL,
	[Amenities] [ntext] NULL,
	[GuaranteeRule] [nvarchar](50) NULL,
	[CancelRule] [nvarchar](50) NULL,
	[RateCat] [nvarchar](50) NULL,
	[property_id] [int] NULL,
	[status] [int] NULL,
	[updatetime] [datetime] NULL,
	[hotel_id] [int] NULL,
	[languagetype] [int] NULL,
	[basis] [bit] NULL,
	[currency] [varchar](50) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_ResvLog_Detail]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_ResvLog_Detail](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[SubID] [int] NOT NULL,
	[VerifyCode] [uniqueidentifier] NOT NULL,
	[PropertyName] [nvarchar](100) NULL,
	[PropertyName_e] [varchar](100) NULL,
	[RoomName] [nvarchar](100) NULL,
	[RoomDesc] [nvarchar](500) NULL,
	[PlanDesc] [nvarchar](500) NULL,
	[GUADesc] [nvarchar](500) NULL,
	[CXLDesc] [nvarchar](500) NULL,
	[TAXDesc] [nvarchar](500) NULL,
 CONSTRAINT [PK_HCRS_ResvLog_Detail] PRIMARY KEY CLUSTERED 
(
	[ID] ASC,
	[SubID] ASC,
	[VerifyCode] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_hotel]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_hotel](
	[htlid] [int] IDENTITY(1,1) NOT NULL,
	[htldomain] [varchar](200) NULL,
	[htlname] [varchar](200) NULL,
	[pid] [int] NULL,
	[pid_e] [int] NULL,
	[gid] [int] NOT NULL,
	[inuser] [varchar](50) NULL,
	[indate] [datetime] NULL,
 CONSTRAINT [PK_hweb_hotel] PRIMARY KEY CLUSTERED 
(
	[htlid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY],
 CONSTRAINT [IX_hweb_hotel] UNIQUE NONCLUSTERED 
(
	[pid] DESC,
	[gid] DESC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FeedBack]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[FeedBack](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[userid] [nvarchar](50) NULL,
	[usertype] [nvarchar](50) NULL,
	[inIp] [varchar](50) NULL,
	[url] [nvarchar](200) NULL,
	[typecode] [varchar](50) NULL,
	[content] [nvarchar](2000) NULL,
	[title] [nvarchar](200) NULL,
	[confnum] [nvarchar](50) NULL,
	[fromemail] [nvarchar](200) NULL,
	[toemail] [nvarchar](200) NULL,
	[updatetime] [varchar](50) NULL,
	[languagetype] [int] NULL CONSTRAINT [DF_FeedBack_languagetype]  DEFAULT (0),
 CONSTRAINT [PK_FeedBack] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_group]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_group](
	[gid] [int] IDENTITY(1,1) NOT NULL,
	[gid_e] [int] NULL,
	[grpname] [varchar](200) NULL,
	[grpdomain] [varchar](200) NULL,
	[inuser] [varchar](50) NULL,
	[indate] [datetime] NULL,
 CONSTRAINT [PK_hweb_group] PRIMARY KEY CLUSTERED 
(
	[gid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Contact]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Contact](
	[AccountIdDsc] [int] NULL,
	[AccountIdName] [nvarchar](160) NULL,
	[Address1_City] [nvarchar](50) NULL,
	[Address1_Country] [nvarchar](50) NULL,
	[Address1_Telephone1] [nvarchar](50) NULL,
	[ParentCustomerIdName] [nvarchar](160) NULL,
	[Salutation] [nvarchar](100) NULL,
	[JobTitle] [nvarchar](100) NULL,
	[FirstName] [nvarchar](50) NULL,
	[LastName] [nvarchar](50) NULL,
	[FullName] [nvarchar](160) NULL,
	[WebSiteUrl] [nvarchar](200) NULL,
	[EMailAddress1] [nvarchar](100) NULL,
	[MobilePhone] [nvarchar](50) NULL,
	[Telephone1] [nvarchar](50) NULL,
	[Fax] [nvarchar](50) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_org_domain]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_org_domain](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[orgtype] [int] NULL,
	[orgid] [int] NULL,
	[webdomain] [nvarchar](100) NULL,
	[noscroll] [int] NULL,
	[css] [ntext] NULL,
	[sloganresv] [nvarchar](4000) NULL,
	[sloganmod] [nvarchar](4000) NULL,
	[slogancxl] [nvarchar](4000) NULL,
	[slogannewresv] [nvarchar](4000) NULL,
	[emailfrom] [nvarchar](200) NULL,
	[emailalias] [nvarchar](200) NULL,
	[emailtitle] [nvarchar](200) NULL,
	[ratecode] [nvarchar](500) NULL,
	[languagetype] [int] NULL,
	[scorevalid] [int] NULL CONSTRAINT [DF_hfg_org_domain_scorevalid]  DEFAULT (3),
	[scoretype] [int] NULL,
	[roomchange] [bit] NULL CONSTRAINT [DF_hfg_org_domain_roomchange]  DEFAULT (0),
	[scoreratechg] [decimal](18, 4) NULL CONSTRAINT [DF_hfg_org_domain_scoreratechg]  DEFAULT (1000),
	[scorebuy] [bit] NULL CONSTRAINT [DF_hfg_org_domain_scorebuy]  DEFAULT (0),
	[scoreratebuy] [decimal](18, 4) NULL CONSTRAINT [DF_hfg_org_domain_scoreratebuy]  DEFAULT (1000),
 CONSTRAINT [PK_HWEB_ORG_DOMAIN] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[H_plan]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[H_plan](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[property_id] [int] NOT NULL,
	[plancode] [varchar](50) NULL,
	[roomcode] [varchar](50) NULL,
	[planname] [varchar](200) NULL,
	[roomname] [varchar](200) NULL,
	[plandesc] [varchar](2000) NULL,
	[roomdesc] [varchar](2000) NULL,
	[updatetime] [datetime] NULL CONSTRAINT [DF_H_plan_updatetime]  DEFAULT (getdate()),
	[type] [varchar](50) NULL,
	[languagetype] [int] NULL CONSTRAINT [DF_H_plan_languagetype]  DEFAULT (0),
	[available] [int] NULL,
	[AddBed] [int] NULL,
	[Net] [int] NULL,
	[Nosmoke] [int] NULL,
 CONSTRAINT [PK_H_plan] PRIMARY KEY CLUSTERED 
(
	[ID] ASC,
	[property_id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[NewsEmail]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[NewsEmail](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[guid] [uniqueidentifier] NULL CONSTRAINT [DF_NewsEmail_guid]  DEFAULT (newid()),
	[email] [varchar](50) NULL,
	[name] [varchar](50) NULL,
	[industry] [varchar](50) NULL,
	[company] [varchar](200) NULL,
	[job] [varchar](50) NULL,
	[city] [varchar](50) NULL,
	[country] [varchar](50) NULL,
	[status] [int] NULL CONSTRAINT [DF_NewsEmail_status]  DEFAULT (0)
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CRM_fit_engine_domain]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[CRM_fit_engine_domain](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[userid] [int] NOT NULL,
	[webdomain] [varchar](50) NULL,
	[noscroll] [int] NULL CONSTRAINT [DF_CRM_fit_engine_domain_noscroll]  DEFAULT (0),
	[RateCode] [varchar](500) NULL,
	[css] [text] NULL,
	[sloganResv] [nvarchar](4000) NULL,
	[sloganMod] [nvarchar](4000) NULL,
	[sloganCxl] [nvarchar](4000) NULL,
	[sloganNewResv] [nvarchar](4000) NULL,
	[EmailFrom] [varchar](50) NULL,
	[EmailAlias] [varchar](50) NULL,
	[EmailTitle] [nvarchar](100) NULL,
	[languagetype] [int] NULL CONSTRAINT [DF_CRM_fit_engine_domain_languagetype]  DEFAULT (0),
	[IsMember] [bit] NULL DEFAULT (0),
	[MemberType] [nvarchar](100) NULL,
	[CardRemark] [nvarchar](20) NOT NULL DEFAULT ('卡号'),
	[CardVE] [nvarchar](100) NULL,
 CONSTRAINT [PK_CRM_fit_engine_domain] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[rate]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[rate](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[rate] [nvarchar](50) NULL,
	[name] [nvarchar](50) NULL,
	[RPI] [nvarchar](50) NULL,
	[CorpAccount] [nvarchar](50) NULL,
	[FreqGuest] [nvarchar](50) NULL,
	[Desc1] [nvarchar](500) NULL,
	[Desc2] [nvarchar](500) NULL,
	[Desc3] [nvarchar](500) NULL,
	[Amenities] [ntext] NULL,
	[GuaranteeRule] [nvarchar](50) NULL,
	[CancelRule] [nvarchar](50) NULL,
	[RateCat] [nvarchar](50) NULL,
	[property_id] [int] NULL,
	[status] [int] NULL,
	[updatetime] [datetime] NULL CONSTRAINT [DF_rate_updatetime]  DEFAULT (getdate()),
	[hotel_id] [int] NULL,
	[languagetype] [int] NULL CONSTRAINT [DF_rate_languagetype]  DEFAULT (0),
	[basis] [bit] NULL,
	[currency] [varchar](50) NULL,
 CONSTRAINT [PK_rate] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[H_guarule]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[H_guarule](
	[Guarule_id] [int] IDENTITY(1,1) NOT NULL,
	[Property_id] [int] NULL,
	[GType] [nvarchar](50) NULL,
	[Grule] [nvarchar](50) NULL,
	[Grulename] [nvarchar](100) NULL,
	[Grulelevel] [int] NULL,
	[GDescription] [nvarchar](255) NULL,
	[Gnumber] [int] NULL,
	[Gperiod] [nvarchar](50) NULL,
	[languagetype] [int] NULL CONSTRAINT [DF_H_guarule_languagetype]  DEFAULT (0),
	[updatetime] [datetime] NULL CONSTRAINT [DF_H_guarule_updatetime]  DEFAULT (getdate()),
	[userid] [int] NULL,
 CONSTRAINT [PK_H_guarule] PRIMARY KEY CLUSTERED 
(
	[Guarule_id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[H_BaseInfo]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[H_BaseInfo](
	[Hotel_ID] [int] NOT NULL,
	[SpecialID] [int] NULL,
	[Title_e] [nvarchar](255) NULL,
	[Title] [nvarchar](255) NULL,
	[pid_e] [int] NULL,
	[pid] [int] NULL,
	[CopyFrom] [nvarchar](255) NULL,
	[Editor] [nvarchar](20) NULL,
	[Keywords] [nvarchar](255) NULL,
	[Hits] [int] NULL,
	[UpdateTime] [datetime] NULL,
	[DefaultPicUrl] [nvarchar](255) NULL,
	[UploadFiles] [ntext] NULL,
	[PaginationType] [int] NULL,
	[GroupID] [int] NULL,
	[ClassID] [int] NULL,
	[Stars] [int] NULL,
	[TitleFontColor] [nvarchar](7) NULL,
	[TitleFontType] [int] NULL,
	[subtitle_e] [ntext] NULL,
	[subtitle] [ntext] NULL,
	[lowprice] [int] NULL,
	[highprice] [int] NULL,
	[photourl] [nvarchar](50) NULL,
	[ratescount] [int] NULL,
	[address] [nvarchar](50) NULL,
	[resvemail] [nvarchar](50) NULL,
	[booktimes] [int] NULL,
	[modtimes] [int] NULL,
	[cxltimes] [int] NULL,
	[photocount] [int] NULL,
	[AmenityFlags] [nvarchar](255) NULL,
	[AmenityIDs] [int] NULL,
	[DateActivated] [nvarchar](50) NULL,
	[Userstamp] [nvarchar](50) NULL,
	[Holdtime] [nvarchar](50) NULL,
	[City] [nvarchar](50) NULL,
	[State] [nvarchar](50) NULL,
	[Country] [nvarchar](50) NULL,
	[Gmtoffset] [nvarchar](50) NULL,
	[Phone] [nvarchar](50) NULL,
	[Fax] [nvarchar](50) NULL,
	[Latecheckin] [nvarchar](50) NULL,
	[Checkin] [nvarchar](50) NULL,
	[Checkout] [nvarchar](50) NULL,
	[PriceRangeHigh] [int] NULL,
	[PriceRangeLow] [int] NULL,
	[KingBeds] [int] NULL,
	[QueenBeds] [int] NULL,
	[TwinBeds] [int] NULL,
	[DoubleBeds] [int] NULL,
	[ExtraAdult] [int] NULL,
	[MeetingRooms] [int] NULL,
	[MeetingSquareFeet] [int] NULL,
	[MeetingRoomCapacity] [int] NULL,
	[TotalElevators] [int] NULL,
	[TotalFloors] [int] NULL,
	[TotalSuites] [int] NULL,
	[TotalRooms] [int] NULL,
	[HandicappedRooms] [int] NULL,
	[MaxPropertyOccupancy] [int] NULL,
	[ExtraCharges] [nvarchar](255) NULL,
	[NonSmokingRooms] [nvarchar](50) NULL,
	[CTY] [nvarchar](50) NULL,
	[Longitude] [nvarchar](50) NULL,
	[Latitude] [nvarchar](50) NULL,
	[Timezone] [nvarchar](50) NULL,
	[Address1_e] [nvarchar](255) NULL,
	[Address1] [nvarchar](255) NULL,
	[Address2_e] [nvarchar](255) NULL,
	[Address2] [nvarchar](255) NULL,
	[ExtraChild] [nvarchar](50) NULL,
	[Daterenovated] [nvarchar](50) NULL,
	[Status] [nvarchar](50) NULL,
	[PropType] [nvarchar](50) NULL,
	[DiamondRating] [int] NULL,
	[Currency] [nvarchar](50) NULL,
	[Description] [nvarchar](50) NULL,
	[FOP] [nvarchar](255) NULL,
	[Zip] [nvarchar](50) NULL,
	[Directions] [nvarchar](1000) NULL,
	[PMS] [nvarchar](50) NULL,
	[DateOpened] [nvarchar](50) NULL,
	[Yearlyclosure] [nvarchar](50) NULL,
	[StatusDesc] [nvarchar](50) NULL,
	[pagerank] [int] NULL,
	[contact_name] [nvarchar](50) NULL,
	[contact_title] [nvarchar](50) NULL,
	[languagetype] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[admin]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[admin](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[username] [nvarchar](50) NULL,
	[password] [nvarchar](50) NULL,
	[flag] [ntext] NULL,
	[LastLogin] [datetime] NULL CONSTRAINT [DF_admin_LastLogin]  DEFAULT (getdate()),
	[LastLoginIP] [nvarchar](50) NULL,
	[adduser] [nvarchar](50) NULL,
 CONSTRAINT [PK_admin] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO

IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[admin]') AND name = N'admin_Index_1')
CREATE UNIQUE NONCLUSTERED INDEX [admin_Index_1] ON [dbo].[admin] 
(
	[id] ASC,
	[username] ASC,
	[password] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_user]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_user](
	[uid] [int] IDENTITY(1,1) NOT NULL,
	[usrpassword] [varchar](50) NULL,
	[gid] [int] NULL,
	[lvlid] [int] NULL,
	[endyear] [int] NULL,
	[scores] [decimal](18, 4) NULL CONSTRAINT [DF_hweb_user_scores]  DEFAULT (0),
	[scorefreeze] [decimal](18, 4) NULL,
	[usremail] [varchar](200) NULL,
	[emailformat] [tinyint] NULL CONSTRAINT [DF_hweb_user_emailformat]  DEFAULT (0),
	[emaillanguage] [tinyint] NULL CONSTRAINT [DF_hweb_user_emaillanguage]  DEFAULT (0),
	[usrmobile] [varchar](20) NULL,
	[question] [varchar](100) NULL,
	[answer] [varchar](50) NULL,
	[usrfirstname] [varchar](50) NULL,
	[usrlastname] [varchar](50) NULL,
	[usrgender] [tinyint] NULL,
	[usrbirthday] [datetime] NULL,
	[usrnationality] [varchar](200) NULL,
	[idtype] [varchar](100) NULL,
	[idno] [varchar](100) NULL,
	[usrcountry] [varchar](200) NULL,
	[usrprovince] [varchar](200) NULL,
	[usrcity] [varchar](200) NULL,
	[smoke] [varchar](50) NULL,
	[bed] [varchar](50) NULL,
	[pillow] [varchar](50) NULL,
	[regdate] [datetime] NULL,
	[logdate] [datetime] NULL,
	[logip] [varchar](50) NULL,
	[logcount] [int] NULL,
	[usrstatus] [bit] NULL CONSTRAINT [DF_hweb_user_usrstatus]  DEFAULT (1),
	[emailcheck] [bit] NULL CONSTRAINT [DF_hweb_user_emailcheck]  DEFAULT (0),
	[mobilecheck] [bit] NULL CONSTRAINT [DF_hweb_user_mobilecheck]  DEFAULT (0),
	[usercheckcode] [varchar](50) NULL,
	[ademail] [bit] NULL CONSTRAINT [DF_hweb_user_ademail]  DEFAULT (1),
	[admobile] [bit] NULL CONSTRAINT [DF_hweb_user_admobile]  DEFAULT (1),
	[Checkcodedate] [datetime] NULL,
	[bookingcount] [int] NULL CONSTRAINT [DF_hfg_user_bookingcount]  DEFAULT (0),
	[nightcount] [int] NULL CONSTRAINT [DF_hfg_user_nightcount]  DEFAULT (0),
 CONSTRAINT [PK_hweb_user] PRIMARY KEY CLUSTERED 
(
	[uid] DESC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[H_taxrate]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[H_taxrate](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[property_id] [nvarchar](10) NULL,
	[tax] [varchar](50) NULL,
	[rate] [varchar](50) NULL,
	[include] [int] NULL,
	[updatetime] [datetime] NULL,
 CONSTRAINT [PK_H_taxrate] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Code]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Code](
	[CID] [int] IDENTITY(1,1) NOT NULL,
	[Code] [varchar](50) NULL,
	[CodeName] [varchar](500) NULL,
	[CodeName_e] [varchar](500) NULL,
	[Availability] [varchar](50) NULL,
	[Type] [varchar](50) NULL,
 CONSTRAINT [PK_Code] PRIMARY KEY CLUSTERED 
(
	[CID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[aircode]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[aircode](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[name] [nvarchar](50) NULL,
	[name_e] [nvarchar](50) NULL,
	[code] [nvarchar](50) NULL,
	[type] [nvarchar](50) NULL,
 CONSTRAINT [PK_aircode] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[H_cxlrule]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[H_cxlrule](
	[Cxlrule_id] [int] IDENTITY(1,1) NOT NULL,
	[Property_id] [int] NULL,
	[NoTimeFrame] [nvarchar](50) NULL,
	[Rule] [nvarchar](50) NULL,
	[Rulelevel] [int] NULL,
	[Rulename] [nvarchar](100) NULL,
	[Description] [nvarchar](255) NULL,
	[PenaltyValue] [nvarchar](50) NULL,
	[CNumber] [int] NULL,
	[CancelInPenalty] [int] NULL,
	[NonRefundable] [nvarchar](50) NULL,
	[Period] [nvarchar](50) NULL,
	[Canceltime] [varchar](50) NULL,
	[Cancelday] [varchar](50) NULL,
	[languagetype] [int] NULL CONSTRAINT [DF_H_cxlrule_languagetype]  DEFAULT (0),
	[userid] [int] NULL,
	[updatetime] [datetime] NULL CONSTRAINT [DF_H_cxlrule_updatetime]  DEFAULT (getdate()),
 CONSTRAINT [PK_H_cxlrule] PRIMARY KEY CLUSTERED 
(
	[Cxlrule_id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ta_score]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[ta_score](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[corpid] [char](10) NULL,
	[month] [char](10) NULL,
	[year] [char](10) NULL,
	[score] [int] NULL CONSTRAINT [DF_ta_score_score]  DEFAULT (0),
	[expenditure] [int] NULL CONSTRAINT [DF_ta_score_expenditure]  DEFAULT (0),
	[balance] [int] NULL CONSTRAINT [DF_ta_score_balance]  DEFAULT (0),
	[explain] [nvarchar](200) NULL,
 CONSTRAINT [PK_ta_score] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[H_cache]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[H_cache](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Property_id] [int] NOT NULL,
	[plancode] [varchar](50) NOT NULL,
	[Availdate] [datetime] NOT NULL,
	[singlerate] [decimal](18, 2) NULL,
	[doublerate] [decimal](10, 2) NULL,
	[triplerate] [decimal](10, 2) NULL,
	[quadrate] [decimal](10, 2) NULL,
	[extraadult] [decimal](10, 0) NULL,
	[extrachildren] [decimal](10, 0) NULL,
	[Allotment] [int] NULL,
	[AllotMax] [int] NULL,
	[AvStat] [varchar](50) NULL,
	[MaxLos] [int] NULL,
	[MinLos] [int] NULL,
	[RateCode] [varchar](50) NOT NULL,
	[RoomCode] [nvarchar](50) NOT NULL,
	[Tcode] [char](10) NULL,
	[T_from] [datetime] NULL,
	[T_to] [datetime] NULL,
	[Roomdesc] [varchar](500) NULL,
	[Ratedesc] [varchar](500) NULL,
	[Gua] [nvarchar](50) NULL,
	[Cxl] [nvarchar](50) NULL,
	[PriceNoTax] [decimal](18, 2) NULL,
	[cutOff] [int] NULL,
	[CityID] [int] NULL,
	[CurrencyCode] [varchar](5) NULL CONSTRAINT [DF__H_Cache__Currenc__3F47339B]  DEFAULT ('CNY'),
	[BreakfastNum] [int] NULL CONSTRAINT [DF__H_Cache__Breakfa__403B57D4]  DEFAULT (0),
	[BreakfastPay] [decimal](18, 2) NULL,
	[BroadBand] [bit] NULL CONSTRAINT [DF__H_Cache__BroadBa__412F7C0D]  DEFAULT (0),
 CONSTRAINT [PK_H_cache] PRIMARY KEY CLUSTERED 
(
	[Property_id] ASC,
	[plancode] ASC,
	[Availdate] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_user_email]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_user_email](
	[eid] [int] IDENTITY(1,1) NOT NULL,
	[email] [varchar](200) NOT NULL,
	[gid] [int] NOT NULL,
	[uid] [int] NULL,
 CONSTRAINT [PK_hweb_user_email] PRIMARY KEY CLUSTERED 
(
	[email] ASC,
	[gid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_userup_templog]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_userup_templog](
	[logid] [int] IDENTITY(1,1) NOT NULL,
	[uid] [int] NULL,
	[uupdate] [datetime] NULL DEFAULT (getdate()),
	[lvlid] [int] NULL,
	[lvlname] [nvarchar](200) NULL,
	[gid] [int] NULL,
 CONSTRAINT [PK_HFG_USERUP_TEMPLOG] PRIMARY KEY CLUSTERED 
(
	[logid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_Baseinfo]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_Baseinfo](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[code] [nvarchar](50) NULL,
	[name] [nvarchar](100) NULL,
	[rank] [int] NULL,
	[pid] [int] NULL,
	[type] [int] NULL,
 CONSTRAINT [PK_BASE_INFO] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_user_mobile]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_user_mobile](
	[mobid] [int] IDENTITY(1,1) NOT NULL,
	[mobnumb] [varchar](50) NOT NULL,
	[gid] [int] NOT NULL,
	[uid] [int] NULL,
 CONSTRAINT [PK_hweb_user_mobile] PRIMARY KEY CLUSTERED 
(
	[mobnumb] ASC,
	[gid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[H_tax]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[H_tax](
	[Tax_id] [int] IDENTITY(1,1) NOT NULL,
	[Property_id] [int] NOT NULL,
	[Amount] [nvarchar](50) NULL,
	[Amount1] [decimal](18, 2) NULL,
	[Aunit] [nvarchar](50) NULL,
	[Basis] [nvarchar](50) NULL,
	[TypeCode] [nvarchar](50) NULL,
	[Description] [nvarchar](255) NULL,
	[FeeType] [nvarchar](50) NULL,
	[Spare] [nvarchar](50) NULL,
	[Code] [nvarchar](50) NULL,
	[Method] [nvarchar](50) NULL,
	[Application] [nvarchar](50) NULL,
	[StackOrder] [int] NULL,
	[languagetype] [int] NULL CONSTRAINT [DF_H_tax_languagetype]  DEFAULT (0),
	[userid] [int] NULL,
	[updatetime] [datetime] NULL CONSTRAINT [DF_H_tax_updatetime]  DEFAULT (getdate()),
 CONSTRAINT [PK_H_tax] PRIMARY KEY CLUSTERED 
(
	[Tax_id] ASC,
	[Property_id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[board]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[board](
	[boardid] [int] IDENTITY(1,1) NOT NULL,
	[BoardType] [nvarchar](50) NULL,
	[ParentID] [int] NULL,
	[ParentStr] [nvarchar](250) NULL,
	[Depth] [smallint] NULL,
	[RootID] [int] NULL,
	[Child] [int] NULL,
	[orders] [int] NULL,
	[readme] [nvarchar](255) NULL,
	[BoardMaster] [nvarchar](100) NULL,
	[lastbbsnum] [int] NULL,
	[lasttopicnum] [int] NULL,
	[indexIMG] [nvarchar](255) NULL,
	[todayNum] [int] NULL,
	[content] [ntext] NULL,
	[LastPost] [nvarchar](255) NULL,
	[sid] [int] NULL,
	[Board_Setting] [ntext] NULL,
 CONSTRAINT [PK_board] PRIMARY KEY CLUSTERED 
(
	[boardid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_user_username]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_user_username](
	[userid] [int] IDENTITY(1,1) NOT NULL,
	[username] [varchar](50) NOT NULL,
	[gid] [int] NOT NULL,
	[uid] [int] NULL,
 CONSTRAINT [PK_hweb_user_username] PRIMARY KEY CLUSTERED 
(
	[username] ASC,
	[gid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ArticleClass]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[ArticleClass](
	[ClassID] [int] NOT NULL,
	[ClassName] [nvarchar](50) NULL,
	[ParentID] [int] NULL,
	[ParentPath] [nvarchar](50) NULL,
	[Depth] [int] NULL,
	[RootID] [int] NULL,
	[Child] [int] NULL,
	[PrevID] [int] NULL,
	[NextID] [int] NULL,
	[OrderID] [int] NULL,
	[ClassInputer] [nvarchar](255) NULL,
	[ClassChecker] [nvarchar](255) NULL,
	[ClassMaster] [nvarchar](255) NULL,
	[Readme] [nvarchar](255) NULL,
	[Setting] [int] NULL,
	[LinkUrl] [nvarchar](255) NULL,
	[ClassPicUrl] [nvarchar](255) NULL,
	[SkinID] [int] NULL,
	[LayoutID] [int] NULL,
	[BrowsePurview] [int] NULL,
	[AddPurview] [int] NULL,
	[IsElite] [bit] NOT NULL,
	[ShowOnTop] [bit] NOT NULL,
 CONSTRAINT [PK_ArticleClass] PRIMARY KEY CLUSTERED 
(
	[ClassID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[city]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[city](
	[ClassID] [int] IDENTITY(1,1) NOT NULL,
	[ClassName_e] [nvarchar](50) NULL,
	[ClassName] [nvarchar](50) NULL,
	[ParentID] [int] NULL CONSTRAINT [DF_city_ParentID]  DEFAULT (0),
	[ParentPath] [nvarchar](50) NULL,
	[Depth] [int] NULL CONSTRAINT [DF_city_Depth]  DEFAULT (0),
	[RootID] [int] NULL CONSTRAINT [DF_city_RootID]  DEFAULT (0),
	[Child] [int] NULL CONSTRAINT [DF_city_Child]  DEFAULT (0),
	[PrevID] [int] NULL CONSTRAINT [DF_city_PrevID]  DEFAULT (0),
	[NextID] [int] NULL CONSTRAINT [DF_city_NextID]  DEFAULT (0),
	[OrderID] [int] NULL CONSTRAINT [DF_city_OrderID]  DEFAULT (0),
	[ClassInputer] [nvarchar](255) NULL,
	[ClassChecker] [nvarchar](255) NULL,
	[ClassMaster] [nvarchar](255) NULL,
	[Readme] [nvarchar](255) NULL,
	[Setting] [int] NULL CONSTRAINT [DF_city_Setting]  DEFAULT (0),
	[LinkUrl] [nvarchar](255) NULL,
	[ClassPicUrl] [nvarchar](255) NULL,
	[SkinID] [int] NULL CONSTRAINT [DF_city_SkinID]  DEFAULT (0),
	[LayoutID] [int] NULL CONSTRAINT [DF_city_LayoutID]  DEFAULT (0),
	[BrowsePurview] [int] NULL CONSTRAINT [DF_city_BrowsePurview]  DEFAULT (0),
	[AddPurview] [int] NULL CONSTRAINT [DF_city_AddPurview]  DEFAULT (0),
	[IsElite] [bit] NOT NULL CONSTRAINT [DF_city_IsElite]  DEFAULT (0),
	[ShowOnTop] [bit] NOT NULL CONSTRAINT [DF_city_ShowOnTop]  DEFAULT (0),
 CONSTRAINT [PK_city] PRIMARY KEY CLUSTERED 
(
	[ClassID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_user_cardnumber]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_user_cardnumber](
	[cardid] [int] IDENTITY(1,1) NOT NULL,
	[cardnumber] [varchar](50) NOT NULL,
	[gid] [int] NOT NULL,
	[uid] [int] NULL,
 CONSTRAINT [PK_hweb_user_cardnumber] PRIMARY KEY CLUSTERED 
(
	[cardnumber] ASC,
	[gid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[resvlog_dispute]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[resvlog_dispute](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[distype] [nvarchar](50) NULL,
	[discontent] [nvarchar](2000) NULL,
	[verifycode] [nvarchar](50) NULL,
	[IATA] [nvarchar](50) NULL,
 CONSTRAINT [PK_resvlog_dispute] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_scorebuylog]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_scorebuylog](
	[buyid] [int] IDENTITY(1,1) NOT NULL,
	[gid] [int] NULL,
	[uid] [int] NULL,
	[buydate] [datetime] NULL DEFAULT (getdate()),
	[scorerate] [decimal](18, 4) NULL,
	[totalmoney] [decimal](18, 4) NULL,
	[totalscore] [decimal](18, 4) NULL,
	[admin] [varchar](50) NULL,
	[status] [bit] NULL CONSTRAINT [DF_hfg_scorebuylog_status]  DEFAULT (1),
 CONSTRAINT [PK_HFG_SCOREBUYLOG] PRIMARY KEY CLUSTERED 
(
	[buyid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCMS_PropertyInfo]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCMS_PropertyInfo](
	[id] [int] NOT NULL,
	[hotel_id] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
	[ratecode] [varchar](500) NULL,
	[web_domain] [varchar](500) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Hubs_HotHotelResult]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Hubs_HotHotelResult](
	[HotNO] [int] IDENTITY(1,1) NOT NULL,
	[CityID] [int] NOT NULL,
	[Hotel_ID] [int] NOT NULL,
	[Pid] [int] NOT NULL,
	[nights] [int] NULL,
	[DateFrom] [datetime] NOT NULL,
	[DateEnd] [datetime] NOT NULL,
	[OrderNO] [int] NULL DEFAULT (0),
 CONSTRAINT [PK_HUBS_HOTHOTELRESULT] PRIMARY KEY CLUSTERED 
(
	[Hotel_ID] ASC,
	[DateFrom] ASC,
	[DateEnd] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'热门酒店统计结果' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Hubs_HotHotelResult'

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sales_Kind]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sales_Kind](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](50) NULL,
	[Class] [int] NULL,
	[GroupId] [int] NULL,
	[SalesId] [nvarchar](50) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sales]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Sales](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[UserName] [nvarchar](50) NULL,
	[UserPassword] [nvarchar](50) NULL,
	[RealName] [nvarchar](50) NULL,
	[Tel] [nvarchar](50) NULL,
	[Email] [nvarchar](50) NULL,
	[Remark] [nvarchar](1000) NULL,
	[Company] [nvarchar](1000) NULL,
	[Flag] [int] NULL,
	[AddTime] [datetime] NULL,
	[Kind] [int] NULL,
	[SalesId] [nvarchar](50) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_channel]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_channel](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[code] [nvarchar](50) NULL,
	[name] [nvarchar](50) NULL,
	[remark] [nvarchar](500) NULL,
	[rank] [int] NULL DEFAULT (0),
 CONSTRAINT [PK_HCRS_CHANNEL] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'自动编号' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'HCRS_channel', @level2type=N'COLUMN', @level2name=N'id'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'渠道编号' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'HCRS_channel', @level2type=N'COLUMN', @level2name=N'code'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'渠道名称' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'HCRS_channel', @level2type=N'COLUMN', @level2name=N'name'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注信息' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'HCRS_channel', @level2type=N'COLUMN', @level2name=N'remark'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'HCRS_channel', @level2type=N'COLUMN', @level2name=N'rank'

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[H_City]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[H_City](
	[CityID] [int] NOT NULL,
	[ProvinceID] [int] NULL,
	[Name] [nvarchar](50) NULL,
	[Remark] [nvarchar](50) NULL,
	[Latitude] [varchar](50) NULL,
	[Longitude] [varchar](50) NULL,
	[PhotoUrl] [nvarchar](100) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Corp_contract]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Corp_contract](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[contract_id] [nvarchar](50) NULL,
	[corp_id] [nvarchar](50) NULL,
	[title] [nvarchar](255) NULL,
	[content] [ntext] NULL,
	[updatetime] [datetime] NULL CONSTRAINT [DF_Corp_contract_updatetime]  DEFAULT (getdate())
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_currency]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_currency](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[code] [nvarchar](50) NULL,
	[name] [nvarchar](100) NULL,
	[rate] [decimal](18, 2) NULL,
	[rank] [int] NULL DEFAULT (0),
 CONSTRAINT [PK_HCRS_CURRENCY] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编号' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'HCRS_currency', @level2type=N'COLUMN', @level2name=N'id'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'货币缩写' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'HCRS_currency', @level2type=N'COLUMN', @level2name=N'code'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'货币名称' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'HCRS_currency', @level2type=N'COLUMN', @level2name=N'name'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'兑换比率（100美元对换）' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'HCRS_currency', @level2type=N'COLUMN', @level2name=N'rate'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'HCRS_currency', @level2type=N'COLUMN', @level2name=N'rank'

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_company_user]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_company_user](
	[usrid] [int] IDENTITY(1,1) NOT NULL,
	[corpid] [int] NOT NULL,
	[usrnumb] [varchar](50) NOT NULL,
	[usrpass] [varchar](50) NULL,
	[lastdate] [datetime] NULL,
	[lastip] [varchar](20) NULL,
	[logcount] [int] NULL,
	[usrstatus] [bit] NULL,
	[indate] [datetime] NULL,
	[inuser] [varchar](50) NULL,
	[gid] [int] NULL,
	[pid] [int] NULL,
 CONSTRAINT [PK_HWEB_COMPANY_USER] PRIMARY KEY CLUSTERED 
(
	[corpid] ASC,
	[usrnumb] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Hubs_TAHotel]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Hubs_TAHotel](
	[Hotel_ID] [int] NOT NULL,
	[Score] [int] NULL DEFAULT (5),
	[IsTop] [bit] NOT NULL DEFAULT (0),
	[DateFrom] [datetime] NOT NULL,
	[DateEnd] [datetime] NOT NULL,
	[OrderNO] [int] NULL DEFAULT (0),
 CONSTRAINT [PK_HUBS_TAHOTEL] PRIMARY KEY CLUSTERED 
(
	[Hotel_ID] ASC,
	[DateFrom] ASC,
	[DateEnd] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分销商最爱酒店' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Hubs_TAHotel'

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Corp_hotel]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Corp_hotel](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Corp_id] [int] NULL,
	[Hotel_id] [int] NULL,
	[contract_no] [nvarchar](50) NULL,
	[room_type] [nvarchar](50) NULL,
	[rate_code] [nvarchar](50) NULL,
	[room_desc] [nvarchar](255) NULL,
	[updatetime] [datetime] NULL CONSTRAINT [DF_Corp_hotel_updatetime]  DEFAULT (getdate()),
	[planid] [nvarchar](255) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Article]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Article](
	[ArticleID] [int] IDENTITY(1,1) NOT NULL,
	[SpecialID] [int] NULL,
	[Title] [varchar](500) NULL,
	[Author] [varchar](50) NULL,
	[CopyFrom] [varchar](255) NULL,
	[Editor] [varchar](50) NULL,
	[Keywords] [varchar](255) NULL,
	[Hits] [int] NULL,
	[UpdateTime] [datetime] NULL CONSTRAINT [DF_Article_UpdateTime]  DEFAULT (getdate()),
	[Hot] [bit] NOT NULL,
	[OnTop] [bit] NOT NULL,
	[Elite] [bit] NOT NULL,
	[Passed] [bit] NOT NULL,
	[Content] [ntext] NULL,
	[IncludePic] [bit] NOT NULL,
	[DefaultPicUrl] [nvarchar](255) NULL,
	[UploadFiles] [ntext] NULL,
	[ReadLevel] [int] NULL,
	[ReadPoint] [int] NULL,
	[PaginationType] [int] NULL,
	[ClassID] [int] NULL,
	[Deleted] [bit] NOT NULL CONSTRAINT [DF_Article_Deleted]  DEFAULT (0),
	[Stars] [int] NULL,
	[TitleFontColor] [nvarchar](7) NULL,
	[TitleFontType] [int] NULL,
	[MaxCharPerPage] [int] NULL,
	[subtitle] [nvarchar](255) NULL,
	[language] [int] NULL,
	[subtitle1] [nvarchar](255) NULL,
 CONSTRAINT [PK_Article] PRIMARY KEY CLUSTERED 
(
	[ArticleID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'pid' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Article', @level2type=N'COLUMN', @level2name=N'ReadPoint'

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_cardnumber]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_cardnumber](
	[cardid] [int] IDENTITY(1,1) NOT NULL,
	[orgid] [int] NOT NULL,
	[orgtype] [tinyint] NOT NULL,
	[cardnumber] [varchar](50) NULL,
	[cardpassword] [varchar](50) NULL,
	[cardtype] [int] NULL,
	[uid] [int] NULL,
	[useadm] [varchar](50) NULL,
	[usedate] [datetime] NULL,
	[comment] [varchar](50) NULL,
 CONSTRAINT [PK_hweb_cardnumber] PRIMARY KEY CLUSTERED 
(
	[cardid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY],
 CONSTRAINT [IX_hweb_cardnumber] UNIQUE NONCLUSTERED 
(
	[orgid] DESC,
	[orgtype] ASC,
	[cardnumber] DESC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OTA_DICTIONARY]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[OTA_DICTIONARY](
	[ID] [int] NOT NULL,
	[PARENT_ID] [decimal](18, 0) NULL CONSTRAINT [DF_OTA_DICTIONARY_PARENT_ID]  DEFAULT (0),
	[CODE] [nvarchar](50) NULL,
	[NAME] [nvarchar](1025) NULL,
	[VALUE] [int] NULL,
	[TYPE] [nvarchar](50) NULL,
	[IS_COMMON] [bit] NULL,
	[SEQUENCE] [decimal](18, 0) NULL,
	[DESCRIPTION] [nchar](1025) NULL,
	[URL] [nvarchar](50) NULL,
	[CREATE_ON] [nvarchar](50) NULL,
	[CREATE_TIME] [datetime] NULL CONSTRAINT [DF_OTA_DICTIONARY_CREATE_TIME]  DEFAULT (getdate()),
	[LAST_UPDATE_TIME] [datetime] NULL CONSTRAINT [DF_OTA_DICTIONARY_LAST_UPDATE_TIME]  DEFAULT (getdate()),
	[LAST_UPDATE_ON] [nvarchar](50) NULL,
 CONSTRAINT [PK_OTA_DICTIONARY] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_present]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_present](
	[prsid] [int] IDENTITY(1,1) NOT NULL,
	[gid] [int] NULL CONSTRAINT [DF_hweb_present_gid]  DEFAULT (0),
	[pid] [int] NULL CONSTRAINT [DF_hweb_present_pid]  DEFAULT (0),
	[prsname] [varchar](50) NULL,
	[simg] [varchar](50) NULL,
	[bimg] [varchar](50) NULL,
	[prsunit] [varchar](50) NULL,
	[prsprice] [decimal](19, 4) NULL,
	[prsprovider] [int] NULL,
	[prsscore] [decimal](10, 0) NULL CONSTRAINT [DF_hweb_present_prsscore]  DEFAULT (0),
	[prscomment] [text] NULL,
	[startdate] [datetime] NULL,
	[enddate] [datetime] NULL,
	[prscount] [int] NULL CONSTRAINT [DF_hweb_present_prscount]  DEFAULT (0),
	[prsmax] [int] NULL CONSTRAINT [DF_hfg_present_prsmax]  DEFAULT (0),
	[prstype] [tinyint] NOT NULL,
	[prsstatus] [tinyint] NULL CONSTRAINT [DF_hweb_present_prsstatus]  DEFAULT (0),
	[indate] [datetime] NULL CONSTRAINT [DF_hweb_present_indate]  DEFAULT (getdate()),
	[inuser] [varchar](50) NULL,
	[modidate] [datetime] NULL,
	[modiuser] [varchar](50) NULL,
	[sid] [int] NULL,
 CONSTRAINT [PK_hweb_present] PRIMARY KEY CLUSTERED 
(
	[prsid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[News]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[News](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[letterid] [int] NULL,
	[title] [varchar](500) NULL,
	[subtitle] [varchar](1000) NULL,
	[copyfrom] [varchar](100) NULL,
	[keyword] [varchar](500) NULL,
	[author] [varchar](50) NULL,
	[addtime] [datetime] NULL,
	[content] [varchar](8000) NULL,
	[hits] [int] NULL,
	[type] [varchar](10) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[H_airport]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[H_airport](
	[airport_id] [int] IDENTITY(1,1) NOT NULL,
	[Property_id] [int] NULL,
	[AirportTrans] [nvarchar](255) NULL,
	[Airports] [nvarchar](255) NULL,
	[AirportDirection] [nvarchar](255) NULL,
	[AirportDistance] [int] NULL,
	[AirportUnits] [nvarchar](255) NULL,
 CONSTRAINT [PK_H_airport] PRIMARY KEY CLUSTERED 
(
	[airport_id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[H_CityRemark]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[H_CityRemark](
	[CityID] [int] NOT NULL,
	[LanID] [int] NOT NULL,
	[Remark] [nvarchar](100) NOT NULL,
	[cityDesc] [nvarchar](2000) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[H_availbility]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[H_availbility](
	[planid] [int] IDENTITY(1,1) NOT NULL,
	[hotel_id] [int] NULL,
	[Property_id] [int] NULL,
	[plan] [nvarchar](50) NULL,
	[plandesc] [nvarchar](255) NULL,
	[roomcode] [nvarchar](50) NULL,
	[roomname] [nvarchar](50) NULL,
	[roomdesc] [nvarchar](255) NULL,
	[maxbed] [int] NULL,
	[maxpeople] [int] NULL,
	[ratecode] [nvarchar](50) NULL,
	[ratename] [nvarchar](50) NULL,
	[ratedesc] [nvarchar](255) NULL,
	[guaranteerule] [nvarchar](50) NULL,
	[cancelrule] [nvarchar](50) NULL,
	[single] [money] NULL,
	[double] [money] NULL,
	[triple] [money] NULL,
	[quad] [money] NULL,
	[child] [money] NULL,
	[adult] [money] NULL,
	[total] [money] NULL,
	[status] [int] NULL,
	[updatetime] [datetime] NULL CONSTRAINT [DF_H_availbility_updatetime]  DEFAULT (getdate()),
 CONSTRAINT [PK_H_availbility] PRIMARY KEY CLUSTERED 
(
	[planid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[h_country]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[h_country](
	[countryid] [int] IDENTITY(1,1) NOT NULL,
	[code] [char](2) NULL,
	[countryname] [nvarchar](100) NULL,
	[languagetype] [int] NULL CONSTRAINT [DF_h_country_languagetype]  DEFAULT (0),
 CONSTRAINT [PK_h_country] PRIMARY KEY CLUSTERED 
(
	[countryid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[H_CommercialRemark]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[H_CommercialRemark](
	[CommercialID] [int] NOT NULL,
	[LanID] [int] NOT NULL,
	[Remark] [nvarchar](100) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[H_Commercial]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[H_Commercial](
	[CommercialID] [int] NOT NULL,
	[CityID] [int] NULL,
	[Name] [nvarchar](50) NULL,
	[Remark] [varchar](50) NULL,
	[Latitude] [varchar](50) NULL,
	[Longitude] [varchar](50) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[H_District]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[H_District](
	[DistrictID] [int] NOT NULL,
	[CityID] [int] NULL,
	[Name] [nvarchar](50) NULL,
	[Remark] [nvarchar](100) NULL,
	[Latitude] [varchar](50) NULL,
	[Longitude] [varchar](50) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[H_DistrictRemark]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[H_DistrictRemark](
	[DistrictID] [int] NOT NULL,
	[LanID] [int] NOT NULL,
	[Remark] [nvarchar](100) NOT NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[H_Province]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[H_Province](
	[ProvinceID] [int] NOT NULL,
	[ChinaAreaID] [int] NULL,
	[Name] [nvarchar](50) NULL,
	[Remark] [nvarchar](50) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_ResvLog_Sub]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_ResvLog_Sub](
	[ID] [int] NOT NULL,
	[VerifyCode] [uniqueidentifier] NOT NULL CONSTRAINT [DF_HCRS_ResvLog_Sub_VerifyCode]  DEFAULT (newid()),
	[INDate] [datetime] NULL,
	[OUTDate] [datetime] NULL,
	[RoomType] [varchar](50) NULL,
	[RateClass] [varchar](50) NULL,
	[Rooms] [int] NULL,
	[Nights] [int] NULL,
	[Adults] [int] NULL,
	[Children] [int] NULL,
	[GuestFirstname] [nvarchar](100) NULL,
	[GuestLastname] [nvarchar](100) NULL,
	[GuestEmail] [varchar](200) NULL,
	[GuestPhone] [varchar](100) NULL,
	[GuestCellPhone] [varchar](100) NULL,
	[GuestAddress] [nvarchar](400) NULL,
	[GuestCity] [nvarchar](100) NULL,
	[GuestProvince] [nvarchar](100) NULL,
	[GuestCountry] [nvarchar](100) NULL,
	[GuestZip] [varchar](50) NULL,
	[GUACode] [varchar](50) NULL,
	[CXLCode] [varchar](50) NULL,
	[TAXCode] [varchar](50) NULL,
	[Bfst] [bit] NULL,
	[BfstNum] [int] NULL,
	[BfstPrice] [money] NULL,
	[TotalMount] [money] NULL,
	[DailPrice] [varchar](2000) NULL,
	[CCType] [varchar](50) NULL,
	[CCNumber] [varchar](50) NULL,
	[CCExp] [varchar](50) NULL,
	[CCName] [varchar](100) NULL,
	[Pay] [int] NULL,
	[GetStatus] [int] NULL,
	[PMSNum] [varchar](100) NULL,
	[RoomNum] [varchar](50) NULL,
	[RealINDate] [datetime] NULL,
	[RealOUTDate] [datetime] NULL,
 CONSTRAINT [PK_HCRS_ResvLog_Sub] PRIMARY KEY CLUSTERED 
(
	[ID] ASC,
	[VerifyCode] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[H_ProvinceRemark]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[H_ProvinceRemark](
	[ProvinceID] [int] NOT NULL,
	[LanID] [int] NOT NULL,
	[Remark] [varchar](100) NOT NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[H_group]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[H_group](
	[Group_id] [int] IDENTITY(1,1) NOT NULL,
	[Property_id] [int] NULL,
	[Status] [nvarchar](50) NULL,
	[UseDate] [nvarchar](50) NULL,
	[Description] [nvarchar](255) NULL,
	[StopDate] [datetime] NULL,
	[Code] [nvarchar](50) NULL,
	[StartDate] [datetime] NULL,
	[Name] [nvarchar](50) NULL,
	[languagetype] [int] NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_user_score]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_user_score](
	[talid] [int] IDENTITY(1,1) NOT NULL,
	[uid] [int] NOT NULL,
	[talyear] [int] NOT NULL,
	[talbooktimes] [int] NULL CONSTRAINT [DF_hweb_user_score_talbooktimes]  DEFAULT (0),
	[talroomnights] [int] NULL CONSTRAINT [DF_hweb_user_score_talroomnights]  DEFAULT (0),
	[talconsumenights] [int] NULL CONSTRAINT [DF_hweb_user_score_talconsumenights]  DEFAULT (0),
	[talhotelcount] [int] NULL CONSTRAINT [DF_hweb_user_score_talhotelcount]  DEFAULT (0),
	[talmount] [decimal](19, 4) NULL CONSTRAINT [DF_hfg_user_score_talmount]  DEFAULT (0),
	[talscore] [int] NULL CONSTRAINT [DF_hweb_user_score_talscore]  DEFAULT (0),
	[lastday] [int] NULL CONSTRAINT [DF_hweb_user_score_lastday]  DEFAULT (0),
 CONSTRAINT [PK_hweb_user_score] PRIMARY KEY CLUSTERED 
(
	[talid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[h_proptype]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[h_proptype](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[propcode] [char](3) NOT NULL,
	[propname] [nvarchar](200) NULL,
	[languagetype] [int] NULL,
 CONSTRAINT [PK_H_PROPTYPE] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_admrole]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_admrole](
	[rolid] [int] IDENTITY(1,1) NOT NULL,
	[orgid] [int] NULL,
	[orgtype] [tinyint] NULL CONSTRAINT [DF_hweb_admrole_orgtype]  DEFAULT (0),
	[rolname] [varchar](50) NULL,
	[rolmodules] [varchar](500) NULL,
	[rolgroup] [varchar](5000) NULL,
	[rolhotel] [varchar](5000) NULL,
	[rolcomment] [varchar](100) NULL,
	[roltype] [tinyint] NULL CONSTRAINT [DF_hweb_admrole_roltype]  DEFAULT (0),
 CONSTRAINT [PK_hweb_admrole] PRIMARY KEY CLUSTERED 
(
	[rolid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[H_promotional]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[H_promotional](
	[Promotional_id] [int] IDENTITY(1,1) NOT NULL,
	[Property_id] [int] NULL,
	[Amount] [nvarchar](50) NULL,
	[Basis] [nvarchar](50) NULL,
	[TypeCode] [nvarchar](50) NULL,
	[Description] [nvarchar](255) NULL,
	[FeeType] [nvarchar](50) NULL,
	[Spare] [nvarchar](50) NULL,
	[Code] [nvarchar](50) NULL,
	[Method] [nvarchar](50) NULL,
	[Application] [nvarchar](50) NULL,
	[StackOrder] [int] NULL,
	[languagetype] [int] NULL,
 CONSTRAINT [PK_H_promotional] PRIMARY KEY CLUSTERED 
(
	[Promotional_id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[h_roomcode]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[h_roomcode](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[roomcode] [nvarchar](50) NULL,
	[roomname] [nvarchar](100) NULL,
	[roomtype] [nvarchar](100) NULL,
	[bedtype] [nvarchar](100) NULL,
	[adult] [int] NULL CONSTRAINT [DF__h_roomcod__adult__3EBD23B6]  DEFAULT (0),
	[adultadd] [int] NULL CONSTRAINT [DF__h_roomcod__adult__3FB147EF]  DEFAULT (0),
	[child] [int] NULL CONSTRAINT [DF__h_roomcod__child__40A56C28]  DEFAULT (0),
	[childadd] [int] NULL CONSTRAINT [DF__h_roomcod__child__41999061]  DEFAULT (0),
	[bedtotal] [int] NULL CONSTRAINT [DF__h_roomcod__bedto__428DB49A]  DEFAULT (0),
	[total] [int] NULL CONSTRAINT [DF__h_roomcod__total__4381D8D3]  DEFAULT (0),
	[squaremeter] [nvarchar](50) NULL,
	[floor] [nvarchar](50) NULL,
	[other] [nvarchar](100) NULL,
	[remark] [nvarchar](1000) NULL,
	[avaliable] [int] NULL CONSTRAINT [DF__h_roomcod__avali__4475FD0C]  DEFAULT (1),
	[pid] [int] NOT NULL,
	[userid] [int] NULL,
	[updatetime] [datetime] NULL CONSTRAINT [DF__h_roomcod__updat__456A2145]  DEFAULT (getdate()),
 CONSTRAINT [PK_H_ROOMCODE] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_base_btype]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_base_btype](
	[typid] [int] IDENTITY(1,1) NOT NULL,
	[typnamecn] [varchar](200) NULL,
	[typnameen] [varchar](200) NULL,
	[typrank] [int] NULL,
 CONSTRAINT [PK_hweb_base_btype] PRIMARY KEY CLUSTERED 
(
	[typid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CRM_hotelweb_domain]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[CRM_hotelweb_domain](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[property_id] [int] NOT NULL CONSTRAINT [DF_CRM_hotelweb_domain_property_id]  DEFAULT (0),
	[webdomain] [varchar](50) NULL,
	[noscroll] [int] NULL CONSTRAINT [DF_CRM_hotelweb_domain_noscroll]  DEFAULT (1),
	[RateCode] [varchar](500) NULL,
	[css] [varchar](4000) NULL,
	[sloganResv] [nvarchar](4000) NULL,
	[sloganMod] [nvarchar](4000) NULL,
	[sloganCxl] [nvarchar](4000) NULL,
	[sloganNewResv] [nvarchar](4000) NULL,
	[EmailFrom] [varchar](50) NULL,
	[EmailAlias] [varchar](50) NULL,
	[EmailTitle] [nvarchar](100) NULL,
	[languagetype] [int] NULL CONSTRAINT [DF_CRM_hotelweb_domain_languagetype]  DEFAULT (0),
 CONSTRAINT [PK_CRM_hotelweb_domain] PRIMARY KEY CLUSTERED 
(
	[id] ASC,
	[property_id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Hubs_TARFP]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Hubs_TARFP](
	[RFPID] [int] IDENTITY(1,1) NOT NULL,
	[RFPNO] [varchar](50) NOT NULL,
	[Title] [nvarchar](255) NULL,
	[subtitle] [nvarchar](255) NULL,
	[UpdateTime] [datetime] NULL DEFAULT (getdate()),
	[PageRank] [int] NULL DEFAULT (0),
	[linkman] [nvarchar](100) NULL,
	[phone] [nvarchar](100) NULL,
	[fax] [nvarchar](100) NULL,
	[email] [nvarchar](100) NULL,
	[IATA] [varchar](50) NULL,
	[Remark] [nvarchar](500) NULL,
	[Keywords] [varchar](255) NULL,
	[content] [nvarchar](1000) NULL,
	[Deleted] [bit] NOT NULL DEFAULT (0),
	[language] [int] NULL,
	[EndDate] [datetime] NOT NULL,
	[OnTop] [bit] NULL DEFAULT (0),
	[Hit] [int] NULL DEFAULT (0),
 CONSTRAINT [PK_HUBS_TARFP] PRIMARY KEY CLUSTERED 
(
	[RFPNO] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'hubs_TA需求信息表' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Hubs_TARFP'

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_creditcard]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_creditcard](
	[cid] [int] IDENTITY(1,1) NOT NULL,
	[uid] [int] NULL,
	[creditcardtype] [char](2) NULL,
	[creditcardno] [varchar](50) NULL,
	[expirationdate] [datetime] NULL,
	[cardname] [varchar](100) NULL,
	[crank] [int] NULL,
	[indate] [datetime] NULL,
 CONSTRAINT [PK_hweb_creditcard] PRIMARY KEY CLUSTERED 
(
	[cid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Hotel]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Hotel](
	[Hotel_ID] [int] IDENTITY(1,1) NOT NULL,
	[SpecialID] [int] NULL,
	[Title_e] [nvarchar](255) NULL,
	[Title] [nvarchar](255) NULL,
	[pid_e] [int] NULL,
	[pid] [int] NOT NULL,
	[CopyFrom] [nvarchar](255) NULL,
	[Editor] [nvarchar](20) NULL,
	[Keywords] [nvarchar](255) NULL,
	[Hits] [int] NULL,
	[UpdateTime] [datetime] NULL CONSTRAINT [DF_Hotel_UpdateTime]  DEFAULT (getdate()),
	[Hot] [bit] NOT NULL CONSTRAINT [DF_Hotel_Hot]  DEFAULT (0),
	[OnTop] [bit] NOT NULL CONSTRAINT [DF_Hotel_OnTop]  DEFAULT (0),
	[Elite] [bit] NOT NULL CONSTRAINT [DF_Hotel_Elite]  DEFAULT (0),
	[Passed] [bit] NOT NULL CONSTRAINT [DF_Hotel_Passed]  DEFAULT (1),
	[enPassed] [bit] NULL,
	[IncludePic] [bit] NOT NULL CONSTRAINT [DF_Hotel_IncludePic]  DEFAULT (0),
	[DefaultPicUrl] [nvarchar](255) NULL,
	[UploadFiles] [ntext] NULL,
	[PaginationType] [int] NULL,
	[GroupID] [int] NULL CONSTRAINT [DF_Hotel_GroupID]  DEFAULT (0),
	[ClassID] [int] NULL,
	[Deleted] [bit] NOT NULL CONSTRAINT [DF_Hotel_Deleted]  DEFAULT (0),
	[Stars] [int] NULL,
	[Diamond] [int] NULL,
	[TitleFontColor] [nvarchar](7) NULL,
	[TitleFontType] [int] NULL,
	[subtitle_e] [ntext] NULL,
	[subtitle] [ntext] NULL,
	[lowprice] [int] NULL CONSTRAINT [DF_Hotel_lowprice]  DEFAULT (0),
	[highprice] [int] NULL CONSTRAINT [DF_Hotel_highprice]  DEFAULT (0),
	[photourl] [nvarchar](50) NULL,
	[ratescount] [int] NULL,
	[address] [nvarchar](50) NULL,
	[resvemail] [nvarchar](50) NULL,
	[booktimes] [int] NULL CONSTRAINT [DF_Hotel_booktimes]  DEFAULT (0),
	[modtimes] [int] NULL CONSTRAINT [DF_Hotel_modtimes]  DEFAULT (0),
	[cxltimes] [int] NULL CONSTRAINT [DF_Hotel_cxltimes]  DEFAULT (0),
	[photocount] [int] NULL CONSTRAINT [DF_Hotel_photocount]  DEFAULT (0),
	[AmenityFlags] [nvarchar](255) NULL,
	[AmenityIDs] [int] NULL CONSTRAINT [DF_Hotel_AmenityIDs]  DEFAULT (0),
	[DateActivated] [nvarchar](50) NULL,
	[Userstamp] [nvarchar](50) NULL,
	[Holdtime] [nvarchar](50) NULL,
	[City] [nvarchar](50) NULL,
	[State] [nvarchar](50) NULL,
	[Country] [nvarchar](50) NULL,
	[Gmtoffset] [nvarchar](50) NULL,
	[Phone] [nvarchar](50) NULL,
	[Fax] [nvarchar](50) NULL,
	[Latecheckin] [nvarchar](50) NULL,
	[Checkin] [nvarchar](50) NULL,
	[Checkout] [nvarchar](50) NULL,
	[PriceRangeHigh] [int] NULL CONSTRAINT [DF_Hotel_PriceRangeHigh]  DEFAULT (0),
	[PriceRangeLow] [int] NULL CONSTRAINT [DF_Hotel_PriceRangeLow]  DEFAULT (0),
	[KingBeds] [int] NULL CONSTRAINT [DF_Hotel_KingBeds]  DEFAULT (0),
	[QueenBeds] [int] NULL CONSTRAINT [DF_Hotel_QueenBeds]  DEFAULT (0),
	[TwinBeds] [int] NULL CONSTRAINT [DF_Hotel_TwinBeds]  DEFAULT (0),
	[DoubleBeds] [int] NULL CONSTRAINT [DF_Hotel_DoubleBeds]  DEFAULT (0),
	[ExtraAdult] [int] NULL CONSTRAINT [DF_Hotel_ExtraAdult]  DEFAULT (0),
	[MeetingRooms] [int] NULL CONSTRAINT [DF_Hotel_MeetingRooms]  DEFAULT (0),
	[MeetingSquareFeet] [int] NULL CONSTRAINT [DF_Hotel_MeetingSquareFeet]  DEFAULT (0),
	[MeetingRoomCapacity] [int] NULL CONSTRAINT [DF_Hotel_MeetingRoomCapacity]  DEFAULT (0),
	[TotalElevators] [int] NULL CONSTRAINT [DF_Hotel_TotalElevators]  DEFAULT (0),
	[TotalFloors] [int] NULL CONSTRAINT [DF_Hotel_TotalFloors]  DEFAULT (0),
	[TotalSuites] [int] NULL CONSTRAINT [DF_Hotel_TotalSuites]  DEFAULT (0),
	[TotalRooms] [int] NULL CONSTRAINT [DF_Hotel_TotalRooms]  DEFAULT (0),
	[HandicappedRooms] [int] NULL CONSTRAINT [DF_Hotel_HandicappedRooms]  DEFAULT (0),
	[MaxPropertyOccupancy] [int] NULL CONSTRAINT [DF_Hotel_MaxPropertyOccupancy]  DEFAULT (0),
	[ExtraCharges] [nvarchar](255) NULL,
	[NonSmokingRooms] [nvarchar](50) NULL,
	[CTY] [nvarchar](50) NULL,
	[Longitude] [nvarchar](50) NULL,
	[Latitude] [nvarchar](50) NULL,
	[Timezone] [nvarchar](50) NULL,
	[Address1_e] [nvarchar](255) NULL,
	[Address1] [nvarchar](255) NULL,
	[Address2_e] [nvarchar](255) NULL,
	[Address2] [nvarchar](255) NULL,
	[ExtraChild] [nvarchar](50) NULL,
	[Daterenovated] [nvarchar](50) NULL,
	[Status] [nvarchar](50) NULL,
	[PropType] [nvarchar](50) NULL,
	[DiamondRating] [int] NULL CONSTRAINT [DF_Hotel_DiamondRating]  DEFAULT (0),
	[Currency] [nvarchar](50) NULL,
	[Description] [nvarchar](50) NULL,
	[FOP] [nvarchar](255) NULL,
	[Zip] [nvarchar](50) NULL,
	[Directions] [nvarchar](1000) NULL,
	[PMS] [nvarchar](50) NULL,
	[DateOpened] [nvarchar](50) NULL,
	[Yearlyclosure] [nvarchar](50) NULL,
	[StatusDesc] [nvarchar](50) NULL,
	[credit] [int] NULL CONSTRAINT [DF_Hotel_credit]  DEFAULT (0),
	[pagerank] [int] NULL CONSTRAINT [DF_Hotel_pagerank]  DEFAULT (0),
	[enPagerank] [int] NULL,
	[languagetype] [int] NULL CONSTRAINT [DF_Hotel_language]  DEFAULT (0),
	[contact_name] [nvarchar](50) NULL,
	[contact_title] [nvarchar](50) NULL,
	[Countryid] [nvarchar](50) NULL,
	[Provinceid] [int] NULL,
	[Cityid] [int] NULL,
	[Districtid] [int] NULL,
	[Commercialid] [int] NULL,
	[ServiceCharge] [int] NULL CONSTRAINT [DF_Hotel_ServiceCharge]  DEFAULT (0),
	[localLongitude] [nvarchar](50) NULL,
	[localLatitude] [nvarchar](50) NULL,
 CONSTRAINT [PK_Hotel] PRIMARY KEY CLUSTERED 
(
	[Hotel_ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Photo]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Photo](
	[PhotoID] [int] IDENTITY(1,1) NOT NULL,
	[PhotoName_e] [nvarchar](255) NULL,
	[PhotoName] [nvarchar](255) NULL,
	[Hits] [int] NULL CONSTRAINT [DF_Photo_Hits]  DEFAULT (0),
	[DayHits] [int] NULL CONSTRAINT [DF_Photo_DayHits]  DEFAULT (0),
	[WeekHits] [int] NULL CONSTRAINT [DF_Photo_WeekHits]  DEFAULT (0),
	[MonthHits] [int] NULL CONSTRAINT [DF_Photo_MonthHits]  DEFAULT (0),
	[UpdateTime] [datetime] NULL CONSTRAINT [DF_Photo_UpdateTime]  DEFAULT (getdate()),
	[PhotoUrl] [nvarchar](200) NULL,
	[PhotoUrl2] [nvarchar](200) NULL,
	[PhotoUrl3] [nvarchar](200) NULL,
	[OnTop] [bit] NOT NULL CONSTRAINT [DF_Photo_OnTop]  DEFAULT (0),
	[Elite] [bit] NOT NULL CONSTRAINT [DF_Photo_Elite]  DEFAULT (0),
	[Passed] [bit] NOT NULL CONSTRAINT [DF_Photo_Passed]  DEFAULT (0),
	[Deleted] [bit] NOT NULL CONSTRAINT [DF_Photo_Deleted]  DEFAULT (0),
	[Stars] [int] NULL CONSTRAINT [DF_Photo_Stars]  DEFAULT (0),
	[LastHitTime] [datetime] NULL,
	[USERID] [int] NULL CONSTRAINT [DF_Photo_USERID]  DEFAULT (0),
	[Phototype] [int] NULL CONSTRAINT [DF_Photo_Phototype]  DEFAULT (0),
	[languagetype] [int] NULL,
 CONSTRAINT [PK_Photo] PRIMARY KEY CLUSTERED 
(
	[PhotoID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_user_address]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_user_address](
	[adrid] [int] IDENTITY(1,1) NOT NULL,
	[uid] [int] NOT NULL,
	[adrtopics] [varchar](50) NULL,
	[usrcountry] [varchar](200) NULL,
	[usrprovince] [varchar](200) NULL,
	[usrcity] [varchar](200) NULL,
	[adrcomment] [varchar](200) NULL,
	[adrpost] [varchar](10) NULL,
	[adrtel] [varchar](50) NULL,
	[adrfax] [varchar](50) NULL,
	[adrcontact] [varchar](50) NULL,
	[indate] [datetime] NULL CONSTRAINT [DF_hweb_user_address_indate]  DEFAULT (getdate()),
	[usetime] [int] NULL CONSTRAINT [DF_hweb_user_address_usetime]  DEFAULT (1),
 CONSTRAINT [PK_hweb_user_address] PRIMARY KEY CLUSTERED 
(
	[adrid] DESC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO

IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[hfg_user_address]') AND name = N'IX_hweb_user_address')
CREATE NONCLUSTERED INDEX [IX_hweb_user_address] ON [dbo].[hfg_user_address] 
(
	[uid] DESC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_levelsetup]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_levelsetup](
	[lvlid] [int] IDENTITY(1,1) NOT NULL,
	[orgid] [int] NULL,
	[orgtype] [tinyint] NULL,
	[lvlname] [varchar](50) NULL,
	[lvlimg] [varchar](50) NULL,
	[startscore] [int] NULL,
	[endscore] [int] NULL,
	[days] [int] NULL CONSTRAINT [DF_hweb_levelsetup_days]  DEFAULT (99999),
	[hotels] [int] NULL CONSTRAINT [DF_hweb_levelsetup_hotels]  DEFAULT (9999),
	[lvlcomment] [varchar](500) NULL,
	[inuser] [varchar](50) NULL,
	[indate] [datetime] NULL,
	[lvlcount] [int] NULL,
	[levelclass] [tinyint] NULL CONSTRAINT [DF_hfg_levelsetup_levelclass]  DEFAULT (0),
 CONSTRAINT [PK_hweb_levelsetup] PRIMARY KEY CLUSTERED 
(
	[lvlid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'级别高低：0最高' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'hfg_levelsetup', @level2type=N'COLUMN', @level2name=N'levelclass'

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_scorelog]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_scorelog](
	[logid] [int] IDENTITY(1,1) NOT NULL,
	[uid] [int] NOT NULL,
	[logdate] [datetime] NULL,
	[indate] [datetime] NULL,
	[outdate] [datetime] NULL,
	[toutdate] [datetime] NULL,
	[conid] [int] NULL,
	[logname] [varchar](50) NULL,
	[scoredate] [datetime] NULL CONSTRAINT [DF_hweb_scorelog_scoredate]  DEFAULT (getdate()),
	[logsort] [tinyint] NULL CONSTRAINT [DF_hweb_scorelog_logsort]  DEFAULT (1),
	[booktotal] [decimal](18, 0) NULL CONSTRAINT [DF_hweb_scorelog_booktotal]  DEFAULT (0),
	[consumetotal] [decimal](18, 0) NULL CONSTRAINT [DF_hweb_scorelog_consumetotal]  DEFAULT (0),
	[score] [decimal](10, 0) NULL CONSTRAINT [DF_hweb_scorelog_score]  DEFAULT (0),
	[fogid] [varchar](50) NULL,
	[verifycode] [varchar](50) NULL,
	[comment] [varchar](200) NULL,
	[logstate] [tinyint] NULL CONSTRAINT [DF_hweb_scorelog_logstate]  DEFAULT (0),
	[valid] [bit] NULL CONSTRAINT [DF_hweb_scorelog_valid]  DEFAULT (1),
	[hid] [int] NULL,
	[gid] [int] NULL,
	[lastdate] [int] NULL CONSTRAINT [DF_hfg_scorelog_lastdate]  DEFAULT (0),
	[scorestatus] [bit] NULL CONSTRAINT [DF_hfg_scorelog_scorestatus]  DEFAULT (0),
 CONSTRAINT [PK_hweb_scorelog] PRIMARY KEY CLUSTERED 
(
	[logid] DESC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_news]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_news](
	[newid] [int] IDENTITY(1,1) NOT NULL,
	[clsid] [int] NULL,
	[clstype] [tinyint] NULL,
	[gid] [int] NULL,
	[pid] [int] NULL,
	[newtopics] [varchar](100) NULL,
	[simg] [varchar](50) NULL,
	[newdetail] [text] NULL,
	[newkey] [varchar](100) NULL,
	[indate] [datetime] NULL CONSTRAINT [DF_hweb_news_indate]  DEFAULT (getdate()),
	[inuser] [varchar](50) NULL,
 CONSTRAINT [PK_hweb_news] PRIMARY KEY CLUSTERED 
(
	[newid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_newsclass]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_newsclass](
	[clsid] [int] IDENTITY(1,1) NOT NULL,
	[gid] [int] NULL,
	[pid] [int] NULL,
	[clsname] [varchar](50) NULL,
	[clstype] [tinyint] NULL,
	[clsrank] [tinyint] NULL,
	[indate] [datetime] NULL CONSTRAINT [DF_hweb_newsclass_indate]  DEFAULT (getdate()),
	[inuser] [varchar](50) NULL,
 CONSTRAINT [PK_hweb_newsclass] PRIMARY KEY CLUSTERED 
(
	[clsid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[h_receiveinfo]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[h_receiveinfo](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[pid] [int] NOT NULL,
	[type] [nvarchar](100) NULL,
	[template] [nvarchar](100) NULL,
	[way] [nvarchar](100) NULL,
	[address] [nvarchar](100) NULL,
	[starttime] [nvarchar](50) NULL,
	[endtime] [nvarchar](50) NULL,
	[weeks] [nvarchar](50) NULL,
	[remark] [nvarchar](500) NULL,
	[avaliable] [int] NULL DEFAULT (1),
 CONSTRAINT [PK_H_RECEIVEINFO] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_company]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_company](
	[corpid] [int] IDENTITY(1,1) NOT NULL,
	[gid] [int] NOT NULL,
	[pid] [int] NOT NULL,
	[corpname] [varchar](200) NULL,
	[corpname_e] [varchar](200) NULL,
	[corptype] [tinyint] NULL,
	[corpcountry] [varchar](200) NULL,
	[corpprovince] [varchar](200) NULL,
	[corpcity] [varchar](200) NULL,
	[corpaddress] [varchar](200) NULL,
	[corppost] [varchar](20) NULL,
	[corptel] [varchar](100) NULL,
	[corpfax] [varchar](100) NULL,
	[corpemail] [varchar](200) NULL,
	[confirstname] [varchar](100) NULL,
	[conlastname] [varchar](100) NULL,
	[congender] [varchar](20) NULL,
	[contel] [varchar](100) NULL,
	[conemail] [varchar](200) NULL,
	[corporate] [varchar](500) NULL,
	[corpiata] [varchar](50) NULL,
	[corpstatus] [tinyint] NULL CONSTRAINT [DF_hweb_company_corpstatus]  DEFAULT (1),
 CONSTRAINT [PK_hweb_company] PRIMARY KEY CLUSTERED 
(
	[corpid] DESC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY],
 CONSTRAINT [IX_hweb_company] UNIQUE NONCLUSTERED 
(
	[gid] DESC,
	[pid] DESC,
	[corpname] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[address]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[address](
	[ip1] [float] NULL,
	[ip2] [float] NULL,
	[country] [nvarchar](50) NULL,
	[city] [nvarchar](50) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_scoresetup]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_scoresetup](
	[stpid] [int] IDENTITY(1,1) NOT NULL,
	[orgid] [int] NULL,
	[orgtype] [tinyint] NULL,
	[stpname] [varchar](50) NULL,
	[startdate] [datetime] NULL,
	[enddate] [datetime] NULL,
	[lvlid] [varchar](50) NULL,
	[hotelstar] [varchar](50) NULL,
	[roomtype] [varchar](50) NULL,
	[unitscore] [int] NULL,
	[stpcomment] [varchar](500) NULL,
	[indate] [datetime] NULL,
	[inuser] [varchar](50) NULL,
 CONSTRAINT [PK_hweb_scoresetup] PRIMARY KEY CLUSTERED 
(
	[stpid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HotelGroup]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HotelGroup](
	[ClassID] [int] IDENTITY(1,1) NOT NULL,
	[ClassName_e] [nvarchar](50) NULL,
	[ClassName] [nvarchar](50) NULL,
	[ParentID] [int] NULL,
	[ParentPath] [nvarchar](50) NULL,
	[Depth] [int] NULL,
	[RootID] [int] NULL,
	[Child] [int] NULL,
	[PrevID] [int] NULL,
	[NextID] [int] NULL,
	[OrderID] [int] NULL,
	[ClassInputer] [nvarchar](255) NULL,
	[ClassChecker] [nvarchar](255) NULL,
	[ClassMaster] [nvarchar](255) NULL,
	[Readme] [nvarchar](255) NULL,
	[Setting] [int] NULL,
	[LinkUrl] [nvarchar](255) NULL,
	[ClassPicUrl] [nvarchar](255) NULL,
	[SkinID] [int] NULL,
	[LayoutID] [int] NULL,
	[BrowsePurview] [int] NULL,
	[AddPurview] [int] NULL,
	[IsElite] [bit] NULL CONSTRAINT [DF_HotelGroup_IsElite]  DEFAULT (0),
	[ShowOnTop] [bit] NULL CONSTRAINT [DF_HotelGroup_ShowOnTop]  DEFAULT (0),
 CONSTRAINT [PK_HotelGroup] PRIMARY KEY CLUSTERED 
(
	[ClassID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_syslog_code]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_syslog_code](
	[lid] [int] NOT NULL,
	[lcname] [varchar](50) NULL,
	[lename] [varchar](50) NULL,
 CONSTRAINT [PK_HWEB_SYSLOG_CODE] PRIMARY KEY CLUSTERED 
(
	[lid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_syslogs]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_syslogs](
	[logid] [int] IDENTITY(1,1) NOT NULL,
	[pid] [int] NOT NULL CONSTRAINT [DF_hweb_syslogs_pid]  DEFAULT (0),
	[gid] [int] NOT NULL CONSTRAINT [DF_hweb_syslogs_gid]  DEFAULT (0),
	[logtime] [smalldatetime] NULL CONSTRAINT [DF_hweb_syslogs_logtime]  DEFAULT (getdate()),
	[loguser] [int] NULL,
	[logip] [varchar](20) NULL,
	[logtype] [tinyint] NULL,
	[logcomment] [varchar](50) NULL,
 CONSTRAINT [PK_hweb_syslogs] PRIMARY KEY CLUSTERED 
(
	[logid] DESC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO

IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[hfg_syslogs]') AND name = N'IX_hweb_syslogs')
CREATE NONCLUSTERED INDEX [IX_hweb_syslogs] ON [dbo].[hfg_syslogs] 
(
	[gid] DESC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[hfg_base_info]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[hfg_base_info](
	[autoid] [int] IDENTITY(1,1) NOT NULL,
	[infotype] [int] NULL,
	[infoid] [int] NULL,
	[infonamecn] [varchar](100) NULL,
	[infonameen] [varchar](100) NULL,
 CONSTRAINT [PK_HWEB_BASE_INFO] PRIMARY KEY CLUSTERED 
(
	[autoid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[theme]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[theme](
	[themeID] [int] IDENTITY(1,1) NOT NULL,
	[Title] [nvarchar](255) NULL,
	[url] [nvarchar](255) NULL,
	[DefaultPicUrl] [nvarchar](255) NULL,
 CONSTRAINT [PK_theme] PRIMARY KEY CLUSTERED 
(
	[themeID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HCRS_Activelog]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HCRS_Activelog](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[pid] [int] NULL,
	[status] [nvarchar](50) NULL,
	[offdate] [datetime] NULL CONSTRAINT [DF__h_activel__offda__7BC631F6]  DEFAULT (getdate()),
	[offuid] [int] NULL,
	[offremark] [nvarchar](100) NULL,
 CONSTRAINT [PK_H_ACTIVELOG] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Userinvite]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Userinvite](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[userid] [int] NULL CONSTRAINT [DF_Userinvite_userid]  DEFAULT (0),
	[activekey] [nvarchar](50) NULL,
	[updatetime] [datetime] NULL CONSTRAINT [DF_Userinvite_updatetime]  DEFAULT (getdate()),
	[status] [int] NULL CONSTRAINT [DF_Userinvite_status]  DEFAULT (0),
	[email] [nvarchar](50) NULL,
	[guestname] [nvarchar](50) NULL,
 CONSTRAINT [PK_Userinvite] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[usergrade]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[usergrade](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[userid] [int] NULL,
	[userlevel] [varchar](50) NULL,
	[userlevel1] [varchar](200) NULL,
	[userlevel2] [varchar](200) NULL,
 CONSTRAINT [PK_usergrade] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[corp_score]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[corp_score](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[corpID] [int] NULL CONSTRAINT [DF_corp_score_corpID]  DEFAULT (0),
	[jul] [int] NULL CONSTRAINT [DF_corp_score_jul]  DEFAULT (0),
	[aug] [int] NULL CONSTRAINT [DF_corp_score_aug]  DEFAULT (0),
	[sep] [int] NULL CONSTRAINT [DF_corp_score_sep]  DEFAULT (0),
	[oct] [int] NULL CONSTRAINT [DF_corp_score_oct]  DEFAULT (0),
	[nov] [int] NULL CONSTRAINT [DF_corp_score_nov]  DEFAULT (0),
	[decm] [int] NULL CONSTRAINT [DF_corp_score_decm]  DEFAULT (0),
	[jan] [int] NULL CONSTRAINT [DF_corp_score_jan]  DEFAULT (0),
	[feb] [int] NULL CONSTRAINT [DF_corp_score_feb]  DEFAULT (0),
	[Mar] [int] NULL CONSTRAINT [DF_corp_score_Mar]  DEFAULT (0),
	[Apr] [int] NULL CONSTRAINT [DF_corp_score_Apr]  DEFAULT (0),
	[May] [int] NULL CONSTRAINT [DF_corp_score_May]  DEFAULT (0),
	[June] [int] NULL CONSTRAINT [DF_corp_score_June]  DEFAULT (0),
	[July] [int] NULL CONSTRAINT [DF_corp_score_July]  DEFAULT (0),
	[August] [int] NULL CONSTRAINT [DF_corp_score_August]  DEFAULT (0),
	[September] [int] NULL CONSTRAINT [DF_corp_score_September]  DEFAULT (0),
	[October] [int] NULL CONSTRAINT [DF_corp_score_October]  DEFAULT (0),
	[November] [int] NULL CONSTRAINT [DF_corp_score_November]  DEFAULT (0),
	[December] [int] NULL CONSTRAINT [DF_corp_score_December]  DEFAULT (0)
) ON [PRIMARY]
END
